Search code examples
soapquickbooksipp-qbd-sync

Quickbooks web connector response if no jobs in queue


I have developed a SOAP web service to use with quickbooks webconnector and everything is working fine but i am facing issues in one case.

Everytime i have a job lined up in queue for web connector to process things are OK, but when there is no job to process the web connector shows error message "Sending Error message to application" though actually nothing was processed.

If in the first request received in

public String sendRequestXML

method if there are no jobs there will be no XML available to return, What should be returned in that case. I have tried returning blank string "", null, Simple Xml headers("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><?qbxml version=\"8.0\"?>") and all these gave the above error in web connector and the error in logs was "Unable to parse request XML".

Also i looked through the docs(QBWC_proguide.pdf) and found that we should send NoOp when there is nothing to process further but this also didn't work.

Please suggest on this issue.


Solution

  • If in the first request received in public String sendRequestXML ...

    This is your problem right here.

    If there aren't any jobs in the queue, then sendRequestXML should not be getting called at all. If it is getting called, then you're not returning the correct response from your authenticate(...) method.

    Here are some examples of valid responses from authenticate:

    Specifically, take note of this:

    If there is nothing to do, you should return this array:

    array(
      'a valid ticket string goes here',    // send the session ID/ticket here
      'none',                               // indicates that the login was valid, but there's nothing to do
    )
    

    If you return none like this, then sendRequestXML will never get called, and you won't get an error.

    Make sure you're returning none like the docs specify.