Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nodejs SOAP module - timout option

Tags:

soap

node.js

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?

like image 946
user2517028 Avatar asked Jan 18 '17 22:01

user2517028


2 Answers

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

like image 134
Duy Huynh Avatar answered Sep 19 '22 06:09

Duy Huynh


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

like image 43
manikawnth Avatar answered Sep 20 '22 06:09

manikawnth