Question
Scott Roth · Feb 23, 2021

Using HTTP.OutboundAdapter to send Page

I am trying to figure out how to send a Page via a HTTP.OutboundAdapter to a URL from Ensemble.

We have a URL that I am able to pass PNo=xxxx%PMsg=xxxx as parameters to send the page to a pager.

http://xxxxx.xxxxx.xxx/Employee/Tools/Paging/SendPage.aspx?PNo=1817&PMsg...

When I send the above URL through a REST client I receive a Response of "SENT".

But when I try to send it through the HTTP.OutboundAdpater I do not get a response.

Method Sample(pReq As osuwmc.Page.DataStructures.Page, Output pResp As %Net.HttpResponse) As %Status
{
    set pInput = "PNo="_pReq.PagerNumber_"&PMsg="_pReq.Message
    set tSC = ..Adapter.Post(.tResponse,,.pInput)
    if ('tSC)
    {
        $$$LOGERROR(tSC)
    }
    quit tSC
}
 
When I call ..Adapter.Post(.tResponse,,.pInput) am I to assume that .pInput is putting
the data into the body of the message and not appending it to the URL?
 
How can I input parameters to be added to the end of the URL that is
being passed in the settings of the Operation?
 
Thanks
Scott
$ZV: Cache for UNIX (IBM AIX for System Power System-64) 2018.1.3 (Build 414U) Mon Oct 28 2019 11:24:02 EDT
Product version:
Ensemble 2018.1
00
2 0 3 46

Replies

Here's a sample. The resulting URL is "/some-url?PNo=12345&PMsg=this%20is%20my%20pager%20message"

Method SendMsg(pRequest As Ens.StringRequest, Output pResponse As Ens.Response) As %Status
{
    set tFormVarNames="PNo,PMsg"
    
    set tPNo = "12345"
    set tPMsg = "this is my pager message"
    
    set tSC=..Adapter.Get(.tHttpResponse, tFormVarNames, tPNo, tPMsg)

    Quit $$$OK
}

Hey Scott.

I think you can achieve this by setting the second parameter to a comma delimted list of the request names, and then pass each value afterwards (in the same order you have the names).

For example:

Method Sample(pReq As osuwmc.Page.DataStructures.Page, Output pResp As %Net.HttpResponse) As %Status
{

    Set FormItems = "PNo,PMsg"
    
    set tSC = ..Adapter.Post(.tResponse,FormItems,pReq.PagerNumber,pReq.Message)

    if ('tSC)

    {

        $$$LOGERROR(tSC)

    }

    quit tSC

}