我正在使用smartface.io调用soap web服务。我的代码如下。当我调用它时,会返回一个错误,显示“服务器错误”,但当我从浏览器调用它时,它工作得很好。
var requestString =
'' +
'' +
'' +
'' +
'admin@borapay.com' +
'Admin@123456<>' +
'' +
'' +
'';
var getRate = new SMF.Net.WebClient({
URL : "http://172.98.72.148/borapay/WebServices/CustomerServices.asmx",
httpMethod : "POST",
requestHeaders : [
"Content-Type: text/xml;charset=UTF-8",
"SOAPAction: http://tempuri.org/UserLogin"
],
onSyndicationSuccess : function (e) {
},
onServerError : function (e) {
alert("onServerError");
},
requestString : requestString,
responseHandling : SMF.Net.ResponseHandling.forceText,
timeoutInterval : 120
});
getRate.run()发布于 2016-03-01 22:42:26
您的请求字符串似乎有误,它应该是完整的信封,如;
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bora="http://bora-pay.com/">
<soapenv:Header/>
<soapenv:Body>
<bora:UserLogin>
<!--Optional:-->
<bora:userName>admin@borapay.com</bora:userName>
<!--Optional:-->
<bora:password>Admin@123456<></bora:password>
</bora:UserLogin>
</soapenv:Body>
</soapenv:Envelope>但您需要将其转换为Java Script字符串。
https://stackoverflow.com/questions/34696869
复制相似问题