【发布时间】:2021-06-28 10:30:27
【问题描述】:
我正在尝试使用 node-soap 发出 SOAP 请求 - 我可以成功创建客户端,但是当我尝试调用 WSDL 中定义的操作时,它返回 undefined?这是我正确调用操作的方式吗?
const soap = require('soap');
const btoa = require('btoa');
response = {}
exports.getInventory = async (event, context) => {
let username = '******';
let password = '**********';
let wsdlUrl = 'https://webservices.onewaybike.nl/CubeServices.svc?wsdl';
const security = new soap.BasicAuthSecurity(username, password);
let client = await soap.createClientAsync(wsdlUrl);
client.setSecurity(security)
let args = { Year: 2020}
let dataResponse = await client.GetStockInfoNewOrdersForSeason(args)
console.log(dataResponse)
response = {
statusCode: 200,
body: "Inventory retrieved."
};
return response;
}
【问题讨论】: