4

I am new to Quickbooks but I have already installed and have an account on Quickbook Premier Desktop Edition along with the Quickbook connector in place. I am trying to sync up the Invoices, Estimates and Customer information from my custom application into Quickbooks via the Quickbook connector that is available. The thing is, the SOAP xml response returned by my application is not accepted by the Quickbook connector as they might differ in format, So i wanted to create a service gateway for this using nodejs preferably wherein this middle tier can process and convert the SOAP according to the format that Quickbook connector accepts. There is a limitation that i cannot directly change the format in which my app is generating the SOAP response. So can anybody suggest where to start and if at all I am thinking in the right direction. Thanks in advance!

newbie
  • 663
  • 2
  • 6
  • 19

1 Answers1

2

Using the soap package, structure your service like so:

var soap = require('soap');

var yourService = {
    QBWebConnectorSvc: {
        QBWebConnectorSvcSoap: {
            serverVersion: function (args) {

                // serverVersion code here

                return {
                    serverVersionResult: { string: retVal }
                };
            },
            clientVersion: function (args) {

                //clientVersion code here

                return {
                    clientVersionResult: { string: retVal }
                };
            },

            // and all other service functions required by QBWC

        }
    }
};

var soapServer = soap.listen(server, '/path-to-your-wsdl', yourService, xml);

Here's a sample response for clientVersion() should look like using that structure:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:tns="http://developer.intuit.com/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
    <soap:Body>
        <tns:clientVersionResponse xmlns:tns="http://developer.intuit.com/" xmlns="http://developer.intuit.com/">
            <tns:clientVersionResult>
                <tns:string></tns:string>
            </tns:clientVersionResult>
        </tns:clientVersionResponse>
    </soap:Body>
</soap:Envelope>

I've written a functional implementation, it's available here.

JohnB
  • 1,231
  • 1
  • 18
  • 33
  • Can this serve multiple incoming requests? I am trying to sync two different QB users at the same point of time, but only one of the requests is getting served at a time..Do I need to use some other framework such as ExpressJs to implement what I am looking for? – newbie Sep 29 '15 at 08:04
  • I am really new to this whole thing, can you point me into the right direction? – newbie Sep 29 '15 at 08:06
  • @newbie as it's written: probably not. The IO is blocking (not very node-like!). Can it? I think so...if it's written to fully support asynchronous callbacks. I have an idea of how it should be done but I've never tested it. I'll get back to you. – JohnB Sep 29 '15 at 14:15
  • Thats exactly what i need, make this support asynchronous callbacks. As soon as I return 'NoOp' to make it wait and there are two or more concurrent requests, it gets messed up. Thanks! – newbie Sep 29 '15 at 15:58
  • Hi John.. Can you share the idea, so that I can try it out may be? – newbie Sep 30 '15 at 12:56
  • 1
    @newbie could you post a new question so that we don't get too off tangent in the comments? That will make it easier for anyone else searching for the same solution. I recommend the title to be something like "How can I asynchronously service multiple QBWC clients with Node.JS?" – JohnB Sep 30 '15 at 15:51
  • Here is the new question : [link] http://stackoverflow.com/questions/32870807/how-to-asynchronously-service-multiple-qbwc-clients-with-nodejs[link] – newbie Sep 30 '15 at 16:07