node-soap icon indicating copy to clipboard operation
node-soap copied to clipboard

Error loading wsdl

Open jafl opened this issue 15 years ago • 7 comments

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)

jafl avatar Sep 28 '11 14:09 jafl

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 avatar Sep 28 '11 15:09 vpulim

@vpulim: Any progress on adding rpc/encoded and rpc/literal binding support?

bbigras avatar Oct 15 '11 16:10 bbigras

@vpulim another +1 to the rpc/encoded and rpc/literal binding support

francof avatar Oct 27 '11 02:10 francof

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

milewise avatar Nov 15 '11 22:11 milewise

awesome :)

Thanks milewise

francof avatar Nov 16 '11 00:11 francof

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');

bbigras avatar Nov 27 '11 16:11 bbigras

@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.

milewise avatar Dec 16 '11 09:12 milewise