We are using soap package to consume SOAP services in Node.js. To invoke method we are using args object to pass the values.
var soap = require('soap');
var url = 'http://example.com/wsdl?wsdl';
var args = {name: 'value'};
soap.createClient(url, function(err, client) {
client.MyFunction(args, function(err, result) {
console.log(result);
});
});
Now the problem is if the parameter value is string we can directly pass in the args object. Suppose if the parameter data type is OptionSetValue then how we can pass that?
<con:KeyValuePairOfstringanyType>
<sys:key>customer_type</sys:key>
<sys:Value i:type="con:OptionSetValue">
<con:Value>100000000</con:Value>
</sys:Value>
</con:KeyValuePairOfstringanyType>
How can we pass the value of customer_type in the args object?