gpt4 book ai didi

javascript - 如何在 node.js 中使用 soap webservices

转载 作者:行者123 更新时间:2023-11-30 16:31:14 28 4
gpt4 key购买 nike

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

请帮忙!

最佳答案

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

关于javascript - 如何在 node.js 中使用 soap webservices,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33294716/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com