Reputation: 78
I use Worklight Adapters with HTTP SOAP request to backend service. So, I had several problems:
for
) to create request string in Adapter?.date
argument has value "2014-10-12T00:00:00+03:00
");I has successful tested this request in SoapUI and received right response. When I try to create request dynamically from procedure arguments, invocation result is failed. Instead, when data is written in the request like string, all works well.
var path = '...';
function procedureName (sessGUID, id, number, date, status) {
var request =
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soa="http://...">
<soapenv:Header/>
<soapenv:Body>
<soa:acceptPayment>
<id>{ id }</id>
<number>{ number }</number>
<date>{ date }</date>
<newStatus>{ status }</newStatus>
<sessGUID>{ sessGUID }</sessGUID>
<loginName></loginName>
<localRequestTime></localRequestTime>
</soa:acceptPayment>
</soapenv:Body>
</soapenv:Envelope>;
var input = {
method : 'post',
returnedContentType : 'xml',
path : path,
body: {
content: request.toString(),
contentType: 'text/xml; charset=UTF-8'
}
};
return WL.Server.invokeHttp(input);
}
Upvotes: 0
Views: 341
Reputation: 3583
appendChild()
in order to build your SOAP envelope. Create the element you want to loop on and append it to its parent.d = new Date(); var n = d.toUTCString();
?Upvotes: 1