首先對我的英語感到抱歉,其次我有一個關於在Node.js中使用SOAP的問題。我是node.js的初學者,我需要幫助。這是我的函數:無法解析響應SOAP Node.js
var soap = require('soap');
var url = 'http://SOMETHING?wsdl';
var args = {
accountId: 'xxxxx',
userName: 'xxxxx',
password: 'xxxxxx',
targetNSAlias: 'tns',
targetNamespace: 'http://api.ilient.com/'
};
soap.createClient(url, function(err, client) {
if(err) throw err;
client.login(args,function(err, result, raw, soapHeader){
if(err) throw err;
console.log(result);
});
});
,當我跑我得到這個錯誤:
Error: Cannot parse response
at /root/node_modules/soap/lib/client.js:321:21
at Request._callback (/root/node_modules/soap/lib/http.js:117:5)
at Request.self.callback (/root/node_modules/request/request.js:186:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (/root/node_modules/request/request.js:1081:10)
at Request.emit (events.js:95:17)
at IncomingMessage.<anonymous> (/root/node_modules/request/request.js:1001:12)
at IncomingMessage.g (events.js:180:16)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
有人能幫我解決嗎? 謝謝並再次抱歉我的英語。