Topic: ReceiveResponseXML method failed for a larger Response

Hi I am sending a request to receive all the Invoices from my QuickBooks Pro 2012 application.

I have around 14k Customer & 17k Invoices, I am able receive the Customer records but not Invoices.

Customer Request :: <?xml version="1.0"?><?qbxml version="4.0"?><QBXML><QBXMLMsgsRq onError="stopOnError"><CustomerQueryRq requestID="1"><ActiveStatus>All</ActiveStatus></CustomerQueryRq></QBXMLMsgsRq></QBXML>             this works fine.

Invoice Request: <?xml version="1.0"?><?qbxml version="4.0"?><QBXML><QBXMLMsgsRq onError="stopOnError"><InvoiceQueryRq requestID="2"><IncludeLineItems>1</IncludeLineItems><IncludeLinkedTxns>1</IncludeLinkedTxns></InvoiceQueryRq></QBXMLMsgsRq></QBXML>.


But received the following error message:
-------------------------------------------------------------------------------------------------------------------------------------------
20121115.15:18:20 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : *** Calling receiveResponseXML() with following parameters:
20121115.15:18:20 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : wcTicket="7824d177-e06f-49fc-9321-0ad55e48d169"
20121115.15:18:20 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : response =
20121115.15:18:20 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<InvoiceQueryRs requestID="2" ......

20121115.15:18:20 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : hresult=""
20121115.15:18:20 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : message=""
20121115.15:18:20 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : QBWC1042: ReceiveResponseXML failed
Error message: The request failed with HTTP status 404: Not Found.
More info:
StackTrace =    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at QBWebConnector.localhost.WCWebServiceDoc.receiveResponseXML(String ticket, String response, String hresult, String message)
   at QBWebConnector.localhost.WCWebService.receiveResponseXML(String ticket, String response, String hresult, String message)
   at QBWebConnector.SOAPWebService.receiveResponseXML(String wcTicket, String response, String hresult, String message)
   at QBWebConnector.WebService.do_receiveResponseXML(String wcTicket, String response, String hresult, String message, Boolean& success, Boolean& timeout)
Source = System.Web.Services
20121115.15:18:20 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

<?xml version="1.0"?><?qbxml version="11.0"?><QBXML><QBXMLMsgsRq onError="s......

----------------------------------------------------------------------------------------------------------------------------------------

Pls someone help me to resolve this issues.  I want to retrieve all the invoices

Thanks in advance for your assistance.
Regards,
Mayil

Re: ReceiveResponseXML method failed for a larger Response

You have the Web Connector pointed at a URL that doesn't exist. Fix our .QWC file to point to the correct URL, and re-load:

20121115.15:18:20 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : QBWC1042: ReceiveResponseXML failed
Error message: The request failed with HTTP status 404: Not Found.
More info:

Re: ReceiveResponseXML method failed for a larger Response

HI, Thanks for your reply.
But the same request working well to receiveResponse from QuickBooks. I tested with Sample company files provided by the QuickBooks Pro 2012 since it has around 1k records in Invoice.

Pls  help me? also let me know, if any way to receive response as 1k records per iteration instead of single iteration. Currently im sending request to receive response in single iteration.

Awaiting for your reply, thanks

Re: ReceiveResponseXML method failed for a larger Response

Your server is very clearly indicating a 404 not found error. Either your server is seriously messed up and returning the wrong HTTP status headers, or you have the Web Connector pointed at the wrong URL. Either way it's a problem on *your* end that you'll need to fix. There's nothing more I can tell you regarding that.

You can read about iterators in the QuickBooks SDK documentation. We also have an example on our wiki:
http://wiki.consolibyte.com/wiki/doku.p … _iterators

Re: ReceiveResponseXML method failed for a larger Response

Hi, Thanks for the information. Actually the issue was the InvoiceQueryRq not returned any response. Ideally it should have returned time out error msg since it was suppose to return a large data from Invoice. Not sure what happened. I also set  <httpRuntime maxRequestLength="999999" enable="true" executionTimeout="400000"/> in web.config.

Also, the link you referred explains sending multiple requests using iteratorID. In my application, I am sending collection of requests(total 66) in sendRequestXML() method in single instance. Each request will be executed based on the counter value. My issue is, If I set MaxReturnValue=1000 for single request, if iteratorRemainingCount=15000, how to send the remaining 15 requests for the first request before the counter executes the second request of Main request.   Pls provide code samples.  Thanks in advance for your assistance...

Re: ReceiveResponseXML method failed for a larger Response

CMAYIL wrote:

Actually the issue was the InvoiceQueryRq not returned any response.

Then your web server doesn't follow the HTTP spec, which is very, very bad.



In my application, I am sending collection of requests(total 66) in sendRequestXML() method in single instance.

This is an extremely poor practice, and will likely result in timeouts and error handler issues for you.


My issue is, If I set MaxReturnValue=1000 for single request, if iteratorRemainingCount=15000, how to send the remaining 15 requests for the first request before the counter executes the second request of Main request.

You can't. That's not the way QuickBooks or the Web Connector works.

Re: ReceiveResponseXML method failed for a larger Response

Hi Thanks for your quick Response. I am using QuickBooks Webconnector 'UpdateSelected' buttonClick event which will automatically executes sendRequestXML & ReceiveResponseXML methods. I need to execute 66 requests( eg: CustomerQueryRq, AccountQueryRq,InvoiceQueryRq etc...) Pls guide me how to accomplish this?

Re: ReceiveResponseXML method failed for a larger Response

Send one request, every time sendRequestXML is called. As long as you return an integer between 1 and 99 inclusive from receiveResponseXML, the Web Connector will continue to call sendRequestXML over and over again.

See the docs in the SDK, and our wiki article:
http://wiki.consolibyte.com/wiki/doku.p … _connector

Re: ReceiveResponseXML method failed for a larger Response

Hi Here is my sendRequestXML method:
public string sendRequestXML(string ticket, string strHCPResponse, string strCompanyFileName,
            string qbXMLCountry, int qbXMLMajorVers, int qbXMLMinorVers)
        {
           
            if (Session["counter"] == null)
            {
                Session["counter"] = 0;
            }         
           
            ArrayList req = buildRequest();
            string request = "";
            int total = req.Count;
            count = Convert.ToInt32(Session["counter"]);
            if (count < total)
            {
                request = req[count].ToString();
                Session["counter"] = ((int)Session["counter"]) + 1;
            }
            else
            {
                count = 0;
                Session["counter"] = 0;
                request = "";
            }
            return request;
        }

Here, the buildRequest arrayList has 66 Main Requests, pls help me, i need to split the first request by setting MaxReturnedValue & by checking iteratorRemainingCount before proceeding with 2nd MainRequest....

Re: ReceiveResponseXML method failed for a larger Response

OK, so go ahead and do that - look at your code, and change it so that it does that. This is a trivial task - just return one single XML request every time sendRequestXML gets called.

I'm not going to write the code for you (especially when you don't even post the complete code, so I couldn't even if I wanted to). It should be very easy for you to go ahead and modify your code to return a single XML request at a time.

Re: ReceiveResponseXML method failed for a larger Response

I have an application that imports orders into QB from a shopping cart, it's been working fine for years and continues to work fine for all orders, except for one order we got yesterday that is producing a "The server committed a protocol violation" error.

1. My app sends the Order to QB

2. QB recieves the order and inserts it corectly

3. QB creates a sucess response and sends it back to my application's receiveResponseXML() method

4. The QB log shows: ReceiveResponseXML failed
Error message: The server committed a protocol violation. Section=ResponseStatusLine

5. The success XML is never recived by my application.

The server is Apache2 running PHP 5.

What's different about this order? It's really long. About 34 line items total. It's inserting itno QB corectly, but I'm wondering if the receiveResponseXML() call is failing because of somthing that only affects large orders? A charector limit? A timeout?

I've seen other problems where this happened to all calls to the server, but since all other calls (including receiveResponseXML() calls from other Sales Receipts) are sucesfull, this has to be a problem that is either order specific or large order specific.

Any ideas?

Re: ReceiveResponseXML method failed for a larger Response

Tamjid Wafaa: Post the logs. Post the qbXML request, and the qbXML response. Post your code. There's nothing we can help you with without more information.