Error loading wsdl
With this code:
var soap = require('soap'); soap.createClient('http://www.SoapClient.com/xml/SQLDataSoap.WSDL', function(err, client) { client.describe(); });
I get this error:
/opt/local/lib/node/.npm/soap/0.0.3/package/lib/wsdl.js:18 var i = nsName.indexOf(':'); ^ TypeError: Cannot call method 'indexOf' of undefined at splitNSName (/opt/local/lib/node/.npm/soap/0.0.3/package/lib/wsdl.js:18:20)
Hi jafl, it looks like this WSDL uses rpc/encoded style bindings. Unfortunately, node-soap currently only supports document/literal wrapped style bindings, which are the most popular. However, i'm currently working on adding rpc/encoded and rpc/literal binding support and it should be released very soon.
Here's a good article on the differences between rpc and document binding styles: http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
@vpulim: Any progress on adding rpc/encoded and rpc/literal binding support?
@vpulim another +1 to the rpc/encoded and rpc/literal binding support
Initial support for rpc binding has been committed. If you have examples of SOAP services that use rpc binding that still don't work, please send the WSDL my way.
@jafl: here is an example how to do a query against the WSDL you asked about: https://gist.github.com/1368564
awesome :)
Thanks milewise
I think I have an example of a SOAP service that use rpc binding that still don't work.
With this code :
var soap = require('soap');
var wsdl = 'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl';
soap.createClient(wsdl, function(err, client) {
if (err) {
console.log(err.stack);
return;
}
else {
console.log("ok");
}
});
I get :
/home/bruno/soap/node_modules/soap/lib/wsdl.js:198
assert(part.name === 'part', 'Expected part element');
@brunoqc your wsdl should now work (use node-soap version 0.1.0 or higher) . that particular service may require HTTP authentication, so you'll need to use soap.BasicAuthSecurity.