![]() |
![]() |
It is important that you still check the statusCode and statusAttribute of the qbXML request as well! You need to be able to handle both Web Connector protocol-level errors *and* qbXML errors.
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <receiveResponseXML xmlns="http://developer.intuit.com/"> <ticket>a05fd1b411f6e22adbb5717f96876b5b</ticket> <response><?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs> <ReceivePaymentAddRs requestID="UmVjZWl2ZVBheW1lbnRBZGR8MTE2" statusCode="0" statusSeverity="Info" statusMessage="Status OK"> <ReceivePaymentRet> <TxnID>1F6-1241605561</TxnID> <TimeCreated>2009-05-06T06:26:01-05:00</TimeCreated> <TimeModified>2009-05-06T06:26:01-05:00</TimeModified> <EditSequence>1241605561</EditSequence> <TxnNumber>139</TxnNumber> <CustomerRef> <ListID>90000-1241602188</ListID> <FullName>Test Company</FullName> </CustomerRef> <ARAccountRef> <ListID>260000-1226546874</ListID> <FullName>Accounts Receivable</FullName> </ARAccountRef> <TxnDate>2009-05-06</TxnDate> <RefNumber>116</RefNumber> <TotalAmount>265.40</TotalAmount> <Memo>Payment for invoice #116</Memo> <DepositToAccountRef> <ListID>270000-1226599344</ListID> <FullName>Undeposited Funds</FullName> </DepositToAccountRef> <UnusedPayment>0.00</UnusedPayment> <UnusedCredits>0.00</UnusedCredits> <AppliedToTxnRet> <TxnID>1EB-1241602355</TxnID> <TxnType>Invoice</TxnType> <TxnDate>2008-05-31</TxnDate> <RefNumber>115</RefNumber> <BalanceRemaining>0.00</BalanceRemaining> <Amount>100.00</Amount> </AppliedToTxnRet> <AppliedToTxnRet> <TxnID>1EE-1241602356</TxnID> <TxnType>Invoice</TxnType> <TxnDate>2008-10-02</TxnDate> <RefNumber>116</RefNumber> <BalanceRemaining>20.00</BalanceRemaining> <Amount>165.40</Amount> </AppliedToTxnRet> </ReceivePaymentRet> </ReceivePaymentAddRs> </QBXMLMsgsRs> </QBXML></response> <hresult /> <message /> </receiveResponseXML> </soap:Body> </soap:Envelope>
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <receiveResponseXML xmlns="http://developer.intuit.com/"> <ticket>438d2fc02a519df5fcc2eef0e7ad3898</ticket> <response /> <hresult>0x80040400</hresult> <message>QuickBooks found an error when parsing the provided XML text stream.</message> </receiveResponseXML> </soap:Body> </soap:Envelope>
If an error has occurred, you can return a -1 to stop processing. If there are no more requests to process, you should return 100 (for 100% done). If there are more requests to process, you should return an integer between 1 and 99 (inclusive) indicating the percentage done the update is.
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://developer.intuit.com/"> <SOAP-ENV:Body> <ns1:receiveResponseXMLResponse> <ns1:receiveResponseXMLResult>100</ns1:receiveResponseXMLResult> </ns1:receiveResponseXMLResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>