How to Serve Multiple QBWC Clients Asynchronously Using Node.js

The idea is to implement a QBWC web service using Node.js, which can serve multiple incoming requests asynchronously. I am currently looking at qbws , which is the Node.js web service for the QuickBooks Desktop web connector. Any ideas on how I can extend this to support an asynchronous architecture for service methods?
Thanks at Advance!

+5
source share
1 answer

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) { // serverVersion code here callback({ serverVersionResult: { string: retVal } }); }, clientVersion: function (args, callback) { //clientVersion code here callback({ clientVersionResult: { string: retVal } }); }, // and all other service functions required by QBWC } } }; 

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).

+4
source

Source: https://habr.com/ru/post/1232637/


All Articles