我将带有HTTP SOAP请求的Worklight Adapters用于后端服务。所以,我有几个问题:
for
)在Adapter?中创建请求字符串。date
参数的值为“2014-10-12T00:00:00+03:00
”); 我已成功在SoapUI中测试了此请求并收到了正确的响应。当我尝试从过程参数动态创建请求时,调用结果失败。相反,当数据像字符串一样写入请求时,一切运行良好。
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);
}
答案 0 :(得分:1)
appendChild()
来构建SOAP信封。创建要循环的元素并将其附加到其父元素。d = new Date(); var n = d.toUTCString();
?