Node.js: how to consume SOAP XML web service

I wonder what is the best way to consume SOAP XML web service with node.js

Thanks!


Solution 1:

You don't have that many options.

You'll probably want to use one of:

  • node-soap
  • strong-soap (rewrite of node-soap)
  • easysoap

Solution 2:

I think that an alternative would be to:

  • use a tool such as SoapUI (http://www.soapui.org) to record input and output xml messages
  • use node request (https://github.com/mikeal/request) to form input xml message to send (POST) the request to the web service (note that standard javascript templating mechanisms such as ejs (http://embeddedjs.com/) or mustache (https://github.com/janl/mustache.js) could help you here) and finally
  • use an XML parser to deserialize response data to JavaScript objects

Yes, this is a rather dirty and low level approach but it should work without problems