How can I set the timeout for soap.createClient
and/or client.myFunction
? It is not mentioned in the documentation. If it not possible, is there a work around?
After an hour of trying, i found it, basically it uses request, and wsdl_options will override request option. You can follow below example. :))
soap.createClient(url, {wsdl_options: {timeout: 5000}}, callback)
ref to: https://github.com/vpulim/node-soap#options
This is what it is mentioned in node-soap documentation
client.MyService.MyPort.MyFunction({name: 'value'}, function(err, result) {
// result is a javascript object
}, {timeout: 5000})
Options are set as 3rd parameter after callback function.
https://github.com/vpulim/node-soap#options-optional
Basically it uses request
module for http transport. So the options of request module are also valid for the soap module
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With