The soap module supports asynchronous function calls , which makes this easy to do. To use the same template as my other answer , here is how you do it:
var soap = require('soap'); var yourService = { QBWebConnectorSvc: { QBWebConnectorSvcSoap: { serverVersion: function (args, callback) {
There are two differences:
- Each method signature has an additional
callback parameter - There is no
return that callback() handles instead.
I currently do not have a suitable testing environment, but I created a client to emulate the QuickBooks Web Connector , and it worked fine. Converting qbws methods to asynchronous allowed him to serve several clients at the same time (including one legitimate QBWC client).
Johnb source share