I'm trying to make a SOAP request using node-soap - I can successful create a client but when I try to call the operation defined in the WSDL it returns undefined? Is this how I correctly call an operation?
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;
}
You have to use the
AsyncMethod.Append
Asyncto the method GetStockInfoNewOrdersForSeasonAsyncThe response is an Array. From the npm soap documentation :