4

I have a scenario where there are a set of tasks and i am using quickbooks web connector for executing them. The user may want to run all tasks or some of them depending on need. Tasks which are for querying data always send static XML and parse response. The ones which need to add data to quickbooks download certain number of files from my application using which qbxml request XML is generated and sent for each file.

The issue is with the tasks which need to ADD data to Quickbooks. They may not always download files depending upon certain conditions. If files are downloaded for a particular task things will work fine but if no file is downloaded for that task then i need to send an empty string in sendRequestXML method. This throws error(unable to parse request) in web connector logs and calls getLastError method in service.

Currently i am sending "NoOp" from getLastError to not show any error in web connector but it doesn't seem to be working. Even after returning "NoOp" from getLastError method and connection being closed the web connector status shows "Sending Errors to application" though there were actually no real errors as no request was sent.

Is NoOp the right thing to do to show the user a success and not an error condition or is there any other String to be returned? Is it Case-Sensitive string like NOOP?

Please help with this.

Raghav
  • 552
  • 1
  • 9
  • 34

2 Answers2

4

I know this is kind of old, but I had this problem quite recently, so here it goes: in these cases where you really need to keep processing something (let's say QBWC is querying if there are new Invoices to be created in QB every 15 minutes) you must pass an empty structure so QB won't complain.

This is what I ended up using:

"<?xml version=\"1.0\"?><?qbxml version=\"13.0\"?><QBXML><QBXMLMsgsRq onError=\"stopOnError\"></QBXMLMsgsRq></QBXML>"    
Flavio Santini
  • 101
  • 1
  • 4
0

Don't send the request. You are controlling what goes to QB with the QBWC server.

William Lorfing
  • 2,656
  • 10
  • 7
  • Since the web connector polls my app for request if for any task no file is downloaded in my app in that case no xml would be generated and anything that i return is taken as invalid and error thrown – Raghav Aug 11 '14 at 18:08
  • I have also handled this to skip any task in the middle that does not download files or does not have a valid xml and process the next task. But this fails if the last task being processed does not download anything. Since in that case i am bound to return something to the web connector in response to sendRequestXml call. – Raghav Aug 11 '14 at 18:10
  • Don't put things in the queue that you need to skip. Only put things into the queue that you actually need to process. – Keith Palmer Jr. Aug 12 '14 at 16:19
  • According to my needs it was not possible to seperate only those tasks which need to process as in everyway the last task executed would always create an issue and NoOp also gave up. So i have resolved it by sending a dummy customer query request with fromDateModified parameter having date 200 years from currentDate so it will not give any response back and it won't produce any errors. – Raghav Aug 13 '14 at 05:08
  • you're not controlling what goes to Qb. not in that sense at least. you can't make requests to the QBWC. The only initiator of the request can be QBWC with the SendRequestXML, to which your server has to respond with it's next request for QBWC, even an empty one. if we could open requests to QBWC, the logic would be reverse since that's the current model upon which most of the web applications work anyway. – BroDev Dec 17 '20 at 19:33