johnballantyne / qbws

A Node.js web service for QuickBooks Desktop Web Connector
MIT License
38 stars 26 forks source link

response from webconnector #10

Closed pmoon7 closed 7 years ago

pmoon7 commented 7 years ago

been playing with qbws....I was able to authenticate but I'm stumped as to how to send and received xml to/from webconnector. Can you give me a clue? Thanks

Code-Crash commented 7 years ago

@pmoon7

Have you looked into the buildRequest():

In authenticating you will see there is a call for buildRequest() function which returns the array of requests.

after web connector login success, the next request from web connector will be sendRequestXML() and in that function, if you see the req , it's getting the first request and again return the values to the QuickBooks.

Please see the document to understand the Web Connector Document.

pmoon7 commented 7 years ago

I did try to read the doc. I was able to trace:

  1. server
  2. client
  3. authenticate but couldn't get to sendrequestXML....not understanding how web connect wsdl work sot it's hard to move it.
Code-Crash commented 7 years ago

@pmoon7 okay.

I guess you are not able to login with the web connector successfully. can you post here the logs from web connector and your javascript qbwc file.

Can you also verify that you are passing the correct username and password matching with the quickbooks web connector?

qbws.QBWebConnectorSvc.QBWebConnectorSvcSoap.authenticate =
function (args) {
    var authReturn = [];

    announceMethod('authenticate', args);
    authReturn[0] = uuid.v1();

    serviceLog('    Password locally stored = ' + password);
    // Put the username and password static over here and try again
    // also verify that you are provide the correct .qwc file for web connector.
    // .qwc file http://wiki.consolibyte.com/wiki/doku.php/quickbooks_web_connector#example_qwc_file example
    if (args.strUserName.trim() ==="QB_USERNAME" && args.strPassword.trim() === "QB_PASSWO") {
        req = buildRequest();

        if (req.length === 0) {
            authReturn[1] = 'NONE';
        } else {
            // An empty string for authReturn[1] means asking QBWebConnector
            // to connect to the company file that is currently opened in QB
            authReturn[1] = companyFile;
        }
    } else {
        authReturn[1] = 'nvu';
    }

    serviceLog('    Return values: ');
    serviceLog('        string[] authReturn[0] = ' + authReturn[0]);
    serviceLog('        string[] authReturn[1] = ' + authReturn[1]);

    return {
        authenticateResult: { 'string': [authReturn[0], authReturn[1]] }
    };
};
pmoon7 commented 7 years ago

John: Thanks for staying with me....here's the log

20170102.20:43:33 UTC : QBWebConnector.WebServiceManager.DoUpdateSelected() : updateWS() for application = 'QuickBooks Integrator' has STARTED 20170102.20:43:33 UTC : QBWebConnector.RegistryManager.getUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock = FALSE 20170102.20:43:33 UTC : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to True 20170102.20:43:33 UTC : QBWebConnector.RegistryManager.setUpdateLock() : Update session locked 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : Initiated connection to the following application. 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppName: QuickBooks Integrator 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppUniqueName (if available): QuickBooks Integrator 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppURL: http://localhost:8000/wsdl 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : Calling serverVersion(). 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : Received from serverVersion() following parameter: 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : This application sent a null for server version. Allowing update operation. 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : Calling clientVersion() with following parameter: 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : Received from clientVersion() following parameter: 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : This application agrees with the current version of QBWebConnector. Allowing update operation. 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application 'QuickBooks Integrator', username = 'admin' 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.do_authenticate() : * Calling authenticate() with following parameters:<password= 20170102.20:43:33 UTC : QBWebConnector.SOAPWebService.do_authenticate() : QBWC1012: Authentication failed due to following error message. Object reference not set to an instance of an object. More info: StackTrace = at QBWebConnector.WebService.do_authenticate(String& ticket, String& companyFileName) Source = QBWebConnector 20170102.20:43:33 UTC : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to False 20170102.20:43:33 UTC : QBWebConnector.RegistryManager.setUpdateLock() : *** Update session unlocked ***** 20170102.20:43:33 UTC : QBWebConnector.WebServiceManager.DoUpdateSelected() : Update completed with errors. See log (QWClog.txt) for details.

pmoon7 commented 7 years ago

John: This is the log from qbws file:

server starting localhost info: Handling POST on /wsdl received: <?xml version="1.0" encoding="utf-8"?></soap:Body></soap:Envelope> info: Attempting to bind to /wsdl info: Trying QBWebConnectorSvcSoap from path /WCWebService/QBWebConnectorSvc.asmx WebMethod: 1 serverVersion() has been called by QBWebConnector No parameters received. No parameters required. Returned: 0.2.1 replied: <?xml version="1.0" encoding="utf-8"?>0.2.1</soap:Body></soap:Envelope> info: Handling POST on /wsdl received: <?xml version="1.0" encoding="utf-8"?>2.2.0.71</soap:Body></soap:Envelope> info: Attempting to bind to /wsdl info: Trying QBWebConnectorSvcSoap from path /WCWebService/QBWebConnectorSvc.asmx WebMethod: 2 clientVersion() has been called by QBWebConnector Parameters received: string strVersion = 2.2.0.71 QBWebConnector Version = 2.2.0.71 Recommended Version = 2.0.1.30 Supported Minimum Version = 1.0 Supplied Version = 2.2 Return values: string retVal = replied: <?xml version="1.0" encoding="utf-8"?></soap:Body></soap:Envelope> info: Handling POST on /wsdl received: <?xml version="1.0" encoding="utf-8"?>AdminDogBone2019</soap:Body></soap:Envelope> info: Attempting to bind to /wsdl info: Trying QBWebConnectorSvcSoap from path /WCWebService/QBWebConnectorSvc.asmx WebMethod: 3 authenticate() has been called by QBWebConnector Parameters received: string strUserName = Admin string strPassword = DogBone2019 Password locally stored = DogBone2019 xxusername Admin : Admin xxpassword DogBone2019 : DogBone2019 customer query <?xml version="1.0"?><?qbxml version="8.0"?>10 invoice query <?xml version="1.0"?><?qbxml version="8.0"?>10 bill query <?xml version="1.0"?><?qbxml version="8.0"?>10 buildRequest xxxx <?xml version="1.0"?><?qbxml version="8.0"?>10 3.1 Authenticate Return values: string[] authReturn[0] = 26bb7d40-d14c-11e6-a95c-b5b0d0c1cbeb string[] authReturn[1] = replied: <?xml version="1.0" encoding="utf-8"?>26bb7d40-d14c-11e6-a95c-b5b0d0c1cbeb</soap:Body></soap:Envelope>

Code-Crash commented 7 years ago

@pmoon7 as per your QuickBooks Log I'm seeing the error Object reference not set to an instance of an object. and from this link I understand that you are not passing the server version to the QuickBooks Web Connector in serverVersion() so just add in the return of the server version is 0.2.1 and for client its fine if you pass the blank.