查看此模块https://www.npmjs.com/package/soap的文档,它们似乎支持超时功能:
Client.method(args, callback, options) - call method on the SOAP service.
The options object is optional and is passed to the request-module. Interesting properties might be:
timeout: Timeout in milliseconds
当我在选项中提供它时,显然它不起作用:
soap.createClient(this.url, function (err, client) {
client.SomeMethod({ request: {} }, (err, result, raw) => {
console.log('...')
}, { timeout: 5000 })
})