如何在node.js中使用soap webservices

时间:2015-10-23 04:07:45

标签: javascript node.js web-services soap

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

请帮忙!

2 个答案:

答案 0 :(得分:2)

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());
               });
        });

答案 1 :(得分:0)

您可以使用更容易与nodeJS一起使用的soapjs