我试图学习node.js并使用node-soap包来使用这个简单的肥皂。 这里给出了WSDL:https://www.dropbox.com/s/f9o79f8jejqwfp3/UserDataService.wsdl,导入的是https://www.dropbox.com/s/4vz0eoh70kvx1bm/import_UserDataService.wsdl
请注意父WSDL中的导入。
所以我执行以下操作来使用soap操作removeUser但是我得到一个错误"无效的子类型"。这是否意味着进口无法完成?
var soap = require('soap');
var url = 'http://localhost/idmsrvc/UserDataService?wsdl';
var args = {id: 'bladigblahddfdfdfdfdfd'};
soap.createClient(url, function(err, client) {
client.removeUser(args, function(err, result) {
console.log(result);
});
});
node test.js
assert.js:92
throw new assert.AssertionError({
^
AssertionError: Invalid child type
at DefinitionsElement.addChild (/home/kasunt/node_modules/soap/lib/wsdl.js:383:5)
at Element.endElement (/home/kasunt/node_modules/soap/lib/wsdl.js:143:14)
at Object.p.onclosetag (/home/kasunt/node_modules/soap/lib/wsdl.js:1162:9)
at emit (/home/kasunt/node_modules/soap/node_modules/sax/lib/sax.js:615:33)
at emitNode (/home/kasunt/node_modules/soap/node_modules/sax/lib/sax.js:620:3)
at closeTag (/home/kasunt/node_modules/soap/node_modules/sax/lib/sax.js:861:5)
at Object.write (/home/kasunt/node_modules/soap/node_modules/sax/lib/sax.js:1294:29)
at WSDL._parse (/home/kasunt/node_modules/soap/lib/wsdl.js:1165:5)
at WSDL._fromXML (/home/kasunt/node_modules/soap/lib/wsdl.js:1171:27)
at /home/kasunt/node_modules/soap/lib/wsdl.js:676:14