如何在node.js中使用soap web服务

我是node.js的新手,我想通过提供请求并获取响应来使用node.js中的SOAP Web服务。 任何人都可以指导我如何做到这一点。 我已经在github中检查过node-soap 。 我不确定如何在那里提供我的请求并得到回应。

请帮助!

var soap = require("soap"); var url = 'WSDL URL goes here'; var args = {ls_input:'1'}; // the request goes here soap.createClient(url, function(err, client) { if(err) { console.log(err); return; } client.Servicename.Portname.OperationName(args, function(err, result) // give appropriate servicename, portname and operation name from the SOAP request { if(err){ console.log(err); return; } console.log(result); console.log("describe", client.describe()); }); }); 

你可以使用soapJs ,它更易于和nodeJS一起使用