Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js: how to consume SOAP XML web service

Tags:

soap

node.js

xml

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

Thanks!

like image 488
WHITECOLOR Avatar asked Dec 28 '11 11:12

WHITECOLOR


People also ask

Does node js support SOAP?

A SOAP client and server for node. js. This module lets you connect to web services using SOAP.


2 Answers

You don't have that many options.

You'll probably want to use one of:

  • node-soap
  • strong-soap (rewrite of node-soap)
  • easysoap
like image 94
Juicy Scripter Avatar answered Sep 23 '22 17:09

Juicy Scripter


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

like image 34
tmanolatos Avatar answered Sep 22 '22 17:09

tmanolatos