Topic: PHP - CodeIgniter Intergration - qbXML issue

Hello all,

I'm having an issue adding a new sales receipt from my web form.  I am able to add both employee's and customer's without an issue but when I moved on to trying to add a salesReceipt I get the following error.

Message:
0x80040400: Quickbooks found an error when parsing the provided XML text stream.

Here are my methods:

function _addSalesReceiptRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale)
{
        // Grab the data from our MySQL database
        $arr = mysql_fetch_assoc(mysql_query("SELECT * FROM my_receipts WHERE id = " . (int) $ID));
   
        $xml = '<?xml version="1.0" encoding="utf-8"?>
            <?qbxml version="2.0"?>
            <QBXML>
                <QBXMLMsgsRq onError="stopOnError">
                    <SalesReceiptAddRq requestID="' . $requestID . '">
                        <SalesReceiptAdd>
                            <CustomerRef>
                                <FullName>' . $arr['name'] . '</FullName>
                            </CustomerRef>
                        </SalesReceiptAdd>
                    </SalesReceiptAddRq>
                </QBXMLMsgsRq>
            </QBXML>';
       
        return $xml;
    }

function _addSalesReceiptResponse($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents)
{
        mysql_query("
            UPDATE
                my_receipts
            SET
                quickbooks_listid = '" . mysql_real_escape_string($idents['ListID']) . "',
                quickbooks_editsequence = '" . mysql_real_escape_string($idents['EditSequence']) . "'
            WHERE
                id = " . (int) $ID);   
    }



Like I said I am able to both enter customers and employee's within the system, so I'm positive the issue lies in the way I'm setting up the XML for the SalesReceipt.


Thanks for any and all help!!

Re: PHP - CodeIgniter Intergration - qbXML issue

Here is the log file for this event:

20130506.22:07:37 UTC    : QBWebConnector.WebServiceManager.DoUpdateSelected() : updateWS() for application = 'CodeIgniter QuickBooks Demo' has STARTED
20130506.22:07:37 UTC    : QBWebConnector.RegistryManager.getUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock = FALSE
20130506.22:07:37 UTC    : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to True
20130506.22:07:37 UTC    : QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session locked *********************
20130506.22:07:37 UTC    : QBWebConnector.SOAPWebService.instantiateWebService() : Initiated connection to the following application.
20130506.22:07:37 UTC    : QBWebConnector.SOAPWebService.instantiateWebService() : AppName: CodeIgniter QuickBooks Demo
20130506.22:07:37 UTC    : QBWebConnector.SOAPWebService.instantiateWebService() : AppUniqueName (if available): CodeIgniter QuickBooks Demo
20130506.22:07:37 UTC    : QBWebConnector.SOAPWebService.instantiateWebService() : AppURL: http://10.0.0.49/hmvc/index.php/connect … books/qbwc
20130506.22:07:37 UTC    : QBWebConnector.SOAPWebService.do_serverVersion() : *** Calling serverVersion().
20130506.22:07:38 UTC    : QBWebConnector.SOAPWebService.do_serverVersion() : Received from serverVersion() following parameter:<serverVersionRet="PHP QuickBooks SOAP Server v2.0 at /hmvc/index.php/connector/quickbooks/qbwc">
20130506.22:07:38 UTC    : QBWebConnector.SOAPWebService.do_clientVersion() : *** Calling clientVersion() with following parameter:<productVersion="2.0.0.139">
20130506.22:07:38 UTC    : QBWebConnector.SOAPWebService.do_clientVersion() : Received from clientVersion() following parameter:<clientVersionRet="">
20130506.22:07:38 UTC    : QBWebConnector.SOAPWebService.do_clientVersion() : This application agrees with the current version of QBWebConnector. Allowing update operation.
20130506.22:07:38 UTC    : QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application 'CodeIgniter QuickBooks Demo', username = 'quickbooks'
20130506.22:07:38 UTC    : QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:<userName="quickbooks"><password=<MaskedForSecurity>
20130506.22:07:39 UTC    : QBWebConnector.SOAPWebService.updateWS() : Received from authenticate() following parameters:<authRet[0]="6ace3c25-2efc-8864-dd13-c0611c3504b0"><authRet[1]=""><authRet[2]=""><authRet[3]="">
20130506.22:07:39 UTC    : QBWebConnector.RegistryManager.setCurrentWebServiceName() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\CurrentWebServiceName has been set to CodeIgniter QuickBooks Demo
20130506.22:07:39 UTC    : QBWebConnector.RegistryManager.setCurrentWebServiceSessionTicket() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\CurrentWebServiceSessionTicket has been set to 6ace3c25-2efc-8864-dd13-c0611c3504b0
20130506.22:07:39 UTC    : QBWebConnector.SOAPWebService.CheckCFNResponse() : User authenticated.
20130506.22:07:39 UTC    : QBWebConnector.SOAPWebService.do_authenticate() : Done.
20130506.22:07:39 UTC    : QBWebConnector.SOAPWebService.OpenConnection() : Connecting to QuickBooks...
20130506.22:07:39 UTC    : QBWebConnector.SOAPWebService.OpenConnection() : Connected., Session started
20130506.22:07:39 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

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

20130506.22:07:39 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<CompanyQueryRs requestID="1" ......

20130506.22:07:39 UTC    : QBWebConnector.CompanyFileLock.getLock() : Got Lock = UNLOCKED:TWDEVS-PC
20130506.22:07:39 UTC    : QBWebConnector.CompanyFileLock.IsLocked() : Lock = UNLOCKED. Returning false.
20130506.22:07:39 UTC    : QBWebConnector.CompanyFileLock.Send_DataExtModRqXML() : XML dump follows: -

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

20130506.22:07:39 UTC    : QBWebConnector.CompanyFileLock.Send_DataExtModRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<DataExtModRs requestID="1" st......

20130506.22:07:39 UTC    : QBWebConnector.CompanyFileLock.setLock() : Lock has been set to value = <LOCKED:TWDEVS-PC:635034748598834000> in QuickBooks for ownerID = <{523faae2-fec9-3884-b182-eedcce6846e4}>
20130506.22:07:40 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

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

20130506.22:07:41 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<CompanyQueryRs requestID="1" ......

20130506.22:07:41 UTC    : QBWebConnector.CompanyFileLock.getLock() : Got Lock = LOCKED:TWDEVS-PC:635034748598834000
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.update() : Company file has been locked for update.
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.update() : Synchronizing with QuickBooks Company Name = The Test Company
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : Asking application to send request no. 1
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : *** Calling sendRequestXML() with following parameters:
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : wcTicket="6ace3c25-2efc-8864-dd13-c0611c3504b0"
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : HCPResponseXML=
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<HostQueryRs requestID="0" sta......

20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : cfn="C:\Users\Public\Documents\Intuit\QuickBooks\Company Files\The Test Company.QBW"
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbNationality="US"
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbXMLMajorVers="10"
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbXMLMinorVers="0"
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : Received from sendRequestXML() following parameter:
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : strRequestXML =
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : XML dump follows: -

<?xml version="1.0" encoding="utf-8"?>
            <?qbxml version="2.0"?>
            <QBXML......

20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : Request xml received.
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : Processing request #1
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : REQUEST: received from application: size (bytes) = 340
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending request to QuickBooks.
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending error message back to application:
HRESULT = 0x80040400
Message: QuickBooks found an error when parsing the provided XML text stream.
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : XML dump follows: -

Request that failed:

<?xml version="1.0" encoding="utf-8"?>
            <?qbxml v......

20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : Response received from QuickBooks (if available):


20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : *** Calling receiveResponseXML() with following parameters:
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : wcTicket="6ace3c25-2efc-8864-dd13-c0611c3504b0"
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : response =
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() :
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : hresult="0x80040400"
20130506.22:07:41 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : message="QuickBooks found an error when parsing the provided XML text stream."
20130506.22:07:42 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : Received from receiveResponseXML() following parameters:
20130506.22:07:42 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : more="-1">
20130506.22:07:42 UTC    : QBWebConnector.SOAPWebService.do_getLastError() : *** Calling getLastError() with following parameter:
20130506.22:07:42 UTC    : QBWebConnector.SOAPWebService.do_getLastError() : wcTicket="6ace3c25-2efc-8864-dd13-c0611c3504b0"
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.do_getLastError() : Received from getLastError() following parameter:
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.do_getLastError() : errorMsg="0x80040400: QuickBooks found an error when parsing the provided XML text stream."
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.do_getLastError() : Received error from application: 0x80040400: QuickBooks found an error when parsing the provided XML text stream.
20130506.22:07:43 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

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

20130506.22:07:43 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<CompanyQueryRs requestID="1" ......

20130506.22:07:43 UTC    : QBWebConnector.CompanyFileLock.getLock() : Got Lock = LOCKED:TWDEVS-PC:635034748598834000
20130506.22:07:43 UTC    : QBWebConnector.CompanyFileLock.Send_DataExtModRqXML() : XML dump follows: -

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

20130506.22:07:43 UTC    : QBWebConnector.CompanyFileLock.Send_DataExtModRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<DataExtModRs requestID="1" st......

20130506.22:07:43 UTC    : QBWebConnector.CompanyFileLock.unsetLock() : Company file has been unlocked for ownerID = <{523faae2-fec9-3884-b182-eedcce6846e4}>
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.update() : Company file has been unlocked.
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.update() : Ending session to QuickBooks.
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.DisconnectFromQB() : Session ended and connection closed
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.do_closeConnection() : *** Calling closeConnection() with following parameter:<wcTicket="6ace3c25-2efc-8864-dd13-c0611c3504b0">
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.do_closeConnection() : Received from closeConnection() following parameter:<ccResponse="Complete!">
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.do_closeConnection() : CloseConnection called to application.
20130506.22:07:43 UTC    : QBWebConnector.SOAPWebService.do_closeConnection() : Response received from application = Complete!
20130506.22:07:44 UTC    : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to False
20130506.22:07:44 UTC    : QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session unlocked *********************
20130506.22:07:44 UTC    : QBWebConnector.SOAPWebService.update() : update completed.
20130506.22:07:44 UTC    : QBWebConnector.WebServiceManager.DoUpdateSelected() : Update for application = 'CodeIgniter QuickBooks Demo' has COMPLETED
20130506.22:07:44 UTC    : QBWebConnector.WebServiceManager.DoUpdateSelected() : Update session has ended.

Re: PHP - CodeIgniter Intergration - qbXML issue

Just like in the QuickBooks GUI, a Sales Receipt has to have at least one line item.

Here's an example (make sure to embed your own requestID attribute):
http://wiki.consolibyte.com/wiki/doku.p … receiptadd
http://wiki.consolibyte.com/wiki/doku.p … mple_qbxml

Re: PHP - CodeIgniter Intergration - qbXML issue

Thank you for your quick response, and it did help me get over that error!  I am able to get it to update now without throwing any errors, but alas I do not see the invoice within Quickbooks hmm

** NOTE: I originally wrote in concerning SalesReceipt, but infact am working on INVOICE.  I updated my methods/xml accordingly. **

Here is my log

20130507.17:55:36 UTC    : QBWebConnector.WebServiceManager.DoUpdateSelected() : updateWS() for application = 'CodeIgniter QuickBooks Demo' has STARTED
20130507.17:55:36 UTC    : QBWebConnector.RegistryManager.getUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock = FALSE
20130507.17:55:36 UTC    : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to True
20130507.17:55:36 UTC    : QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session locked *********************
20130507.17:55:36 UTC    : QBWebConnector.SOAPWebService.instantiateWebService() : Initiated connection to the following application.
20130507.17:55:36 UTC    : QBWebConnector.SOAPWebService.instantiateWebService() : AppName: CodeIgniter QuickBooks Demo
20130507.17:55:36 UTC    : QBWebConnector.SOAPWebService.instantiateWebService() : AppUniqueName (if available): CodeIgniter QuickBooks Demo
20130507.17:55:36 UTC    : QBWebConnector.SOAPWebService.instantiateWebService() : AppURL: http://10.0.0.49/hmvc/index.php/connect … books/qbwc
20130507.17:55:36 UTC    : QBWebConnector.SOAPWebService.do_serverVersion() : *** Calling serverVersion().
20130507.17:55:36 UTC    : QBWebConnector.SOAPWebService.do_serverVersion() : Received from serverVersion() following parameter:<serverVersionRet="PHP QuickBooks SOAP Server v2.0 at /hmvc/index.php/connector/quickbooks/qbwc">
20130507.17:55:36 UTC    : QBWebConnector.SOAPWebService.do_clientVersion() : *** Calling clientVersion() with following parameter:<productVersion="2.0.0.139">
20130507.17:55:36 UTC    : QBWebConnector.SOAPWebService.do_clientVersion() : Received from clientVersion() following parameter:<clientVersionRet="">
20130507.17:55:36 UTC    : QBWebConnector.SOAPWebService.do_clientVersion() : This application agrees with the current version of QBWebConnector. Allowing update operation.
20130507.17:55:37 UTC    : QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application 'CodeIgniter QuickBooks Demo', username = 'quickbooks'
20130507.17:55:37 UTC    : QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:<userName="quickbooks"><password=<MaskedForSecurity>
20130507.17:55:37 UTC    : QBWebConnector.SOAPWebService.updateWS() : Received from authenticate() following parameters:<authRet[0]="e5ad7446-cee5-e584-954d-fcdae4652714"><authRet[1]=""><authRet[2]=""><authRet[3]="">
20130507.17:55:37 UTC    : QBWebConnector.RegistryManager.setCurrentWebServiceName() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\CurrentWebServiceName has been set to CodeIgniter QuickBooks Demo
20130507.17:55:37 UTC    : QBWebConnector.RegistryManager.setCurrentWebServiceSessionTicket() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\CurrentWebServiceSessionTicket has been set to e5ad7446-cee5-e584-954d-fcdae4652714
20130507.17:55:37 UTC    : QBWebConnector.SOAPWebService.CheckCFNResponse() : User authenticated.
20130507.17:55:37 UTC    : QBWebConnector.SOAPWebService.do_authenticate() : Done.
20130507.17:55:37 UTC    : QBWebConnector.SOAPWebService.OpenConnection() : Connecting to QuickBooks...
20130507.17:55:38 UTC    : QBWebConnector.SOAPWebService.OpenConnection() : Connected., Session started
20130507.17:55:38 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

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

20130507.17:55:38 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<CompanyQueryRs requestID="1" ......

20130507.17:55:38 UTC    : QBWebConnector.CompanyFileLock.getLock() : Got Lock = UNLOCKED:TWDEVS-PC
20130507.17:55:38 UTC    : QBWebConnector.CompanyFileLock.IsLocked() : Lock = UNLOCKED. Returning false.
20130507.17:55:38 UTC    : QBWebConnector.CompanyFileLock.Send_DataExtModRqXML() : XML dump follows: -

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

20130507.17:55:38 UTC    : QBWebConnector.CompanyFileLock.Send_DataExtModRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<DataExtModRs requestID="1" st......

20130507.17:55:38 UTC    : QBWebConnector.CompanyFileLock.setLock() : Lock has been set to value = <LOCKED:TWDEVS-PC:635035461383458000> in QuickBooks for ownerID = <{523faae2-fec9-3884-b182-eedcce6846e4}>
20130507.17:55:39 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

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

20130507.17:55:39 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<CompanyQueryRs requestID="1" ......

20130507.17:55:39 UTC    : QBWebConnector.CompanyFileLock.getLock() : Got Lock = LOCKED:TWDEVS-PC:635035461383458000
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.update() : Company file has been locked for update.
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.update() : Synchronizing with QuickBooks Company Name = The Test Company
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : Asking application to send request no. 1
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : *** Calling sendRequestXML() with following parameters:
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : wcTicket="e5ad7446-cee5-e584-954d-fcdae4652714"
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : HCPResponseXML=
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<HostQueryRs requestID="0" sta......

20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : cfn="C:\Users\Public\Documents\Intuit\QuickBooks\Company Files\The Test Company.QBW"
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbNationality="US"
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbXMLMajorVers="10"
20130507.17:55:39 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbXMLMinorVers="0"
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : Received from sendRequestXML() following parameter:
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : strRequestXML =
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : XML dump follows: -

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="5.0"?>
<QBXML>
    <QB......

20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_sendRequestXML() : Request xml received.
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : Processing request #1
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : REQUEST: received from application: size (bytes) = 1114
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending request to QuickBooks.
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : Response received from QuickBooks: size (bytes) = 1966
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending response back to application.
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : *** Calling receiveResponseXML() with following parameters:
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : wcTicket="e5ad7446-cee5-e584-954d-fcdae4652714"
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : response =
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<InvoiceAddRs requestID="110" ......

20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : hresult=""
20130507.17:55:40 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : message=""
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : Received from receiveResponseXML() following parameters:
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : more="100">
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.do_receiveResponseXML() : Done. No more to process.
20130507.17:55:41 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

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

20130507.17:55:41 UTC    : QBWebConnector.CompanyFileLock.Send_CompanyQueryRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<CompanyQueryRs requestID="1" ......

20130507.17:55:41 UTC    : QBWebConnector.CompanyFileLock.getLock() : Got Lock = LOCKED:TWDEVS-PC:635035461383458000
20130507.17:55:41 UTC    : QBWebConnector.CompanyFileLock.Send_DataExtModRqXML() : XML dump follows: -

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

20130507.17:55:41 UTC    : QBWebConnector.CompanyFileLock.Send_DataExtModRqXML() : XML dump follows: -

<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<DataExtModRs requestID="1" st......

20130507.17:55:41 UTC    : QBWebConnector.CompanyFileLock.unsetLock() : Company file has been unlocked for ownerID = <{523faae2-fec9-3884-b182-eedcce6846e4}>
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.update() : Company file has been unlocked.
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.update() : Ending session to QuickBooks.
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.DisconnectFromQB() : Session ended and connection closed
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.do_closeConnection() : *** Calling closeConnection() with following parameter:<wcTicket="e5ad7446-cee5-e584-954d-fcdae4652714">
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.do_closeConnection() : Received from closeConnection() following parameter:<ccResponse="Complete!">
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.do_closeConnection() : CloseConnection called to application.
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.do_closeConnection() : Response received from application = Complete!
20130507.17:55:41 UTC    : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to False
20130507.17:55:41 UTC    : QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session unlocked *********************
20130507.17:55:41 UTC    : QBWebConnector.SOAPWebService.update() : update completed.
20130507.17:55:41 UTC    : QBWebConnector.WebServiceManager.DoUpdateSelected() : Update for application = 'CodeIgniter QuickBooks Demo' has COMPLETED
20130507.17:55:41 UTC    : QBWebConnector.WebServiceManager.DoUpdateSelected() : Update session has ended.

Last edited by cciampoli (2013-05-07 13:17:01)

Re: PHP - CodeIgniter Intergration - qbXML issue

Here are my updated methods.

function _addInvoiceRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale) {
        // Grab the data from our MySQL database
        //$arr = mysql_fetch_assoc(mysql_query("SELECT * FROM my_invoices WHERE id = " . (int) $ID));
   
        $xml = '<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="5.0"?>
<QBXML>
    <QBXMLMsgsRq onError="continueOnError">
        <InvoiceAddRq requestID="' . $requestID . '">
            <InvoiceAdd>
                <CustomerRef>
                    <FullName>Wings and Things</FullName>
                </CustomerRef>
                <TxnDate>2010-01-15</TxnDate>
                <RefNumber>21011</RefNumber>
                <BillAddress>
                    <Addr1>ConsoliBYTE, LLC</Addr1>
                    <Addr2>134 Stonemill Road</Addr2>
                    <Addr3 />
                    <City>Mansfield</City>
                    <State>CT</State>
                    <PostalCode>06268</PostalCode>
                    <Country>United States</Country>
                </BillAddress>
                <ShipAddress>
                    <Addr1>ConsoliBYTE, LLC</Addr1>
                    <Addr2>Attn: Keith Palmer</Addr2>
                    <Addr3>56 Cowles Road</Addr3>
                    <City>Willington</City>
                    <State>CT</State>
                    <PostalCode>06279</PostalCode>
                    <Country>United States</Country>
                </ShipAddress>
                <Memo>Test memo goes here.</Memo>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>123123</FullName>
                    </ItemRef>
                    <Desc>Test item description</Desc>
                    <Quantity>1.00000</Quantity>
                </InvoiceLineAdd>
            </InvoiceAdd>
        </InvoiceAddRq>
    </QBXMLMsgsRq>
</QBXML>';
       
        return $xml;
    }

function _addInvoiceResponse($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents) {
    /*       
        mysql_query("
            UPDATE
                my_invoices
            SET
                quickbooks_listid = '" . mysql_real_escape_string($idents['ListID']) . "',
                quickbooks_editsequence = '" . mysql_real_escape_string($idents['EditSequence']) . "'
            WHERE
                id = " . (int) $ID);   
    */
    $xml = '<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<InvoiceAddRs requestID="' . $requestID . '" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
<InvoiceRet>
<TxnID>773-1263566752</TxnID>
<TimeCreated>2010-01-15T09:45:52-05:00</TimeCreated>
<TimeModified>2010-01-15T09:45:52-05:00</TimeModified>
<EditSequence>1263566752</EditSequence>
<TxnNumber>396</TxnNumber>
<CustomerRef>
<FullName>Wings and Things</FullName>
</CustomerRef>
<ARAccountRef>
<ListID>3B0000-1211511979</ListID>
<FullName>Accounts Receivable</FullName>
</ARAccountRef>
<TemplateRef>
<ListID>D0000-1261262988</ListID>
<FullName>New Template</FullName>
</TemplateRef>
<TxnDate>2010-01-15</TxnDate>
<RefNumber>21011</RefNumber>
<BillAddress>
<Addr1>ConsoliBYTE, LLC</Addr1>
<Addr2>134 Stonemill Road</Addr2>
<City>Mansfield</City>
<State>CT</State>
<PostalCode>06268</PostalCode>
<Country>USA</Country>
</BillAddress>
<ShipAddress>
<Addr1>ConsoliBYTE, LLC</Addr1>
<Addr2>Attn: Keith Palmer</Addr2>
<Addr3>56 Cowles Road</Addr3>
<City>Willington</City>
<State>CT</State>
<PostalCode>06279</PostalCode>
<Country>USA</Country>
</ShipAddress>
<IsPending>false</IsPending>
<IsFinanceCharge>false</IsFinanceCharge>
<TermsRef>
<ListID>20000-1211066025</ListID>
<FullName>Net 30</FullName>
</TermsRef>
<DueDate>2010-02-14</DueDate>
<ShipDate>2010-01-15</ShipDate>
<Subtotal>15.00</Subtotal>
<ItemSalesTaxRef>
<ListID>10000-1211066051</ListID>
<FullName>Out of State</FullName>
</ItemSalesTaxRef>
<SalesTaxPercentage>0.00</SalesTaxPercentage>
<SalesTaxTotal>0.00</SalesTaxTotal>
<AppliedAmount>0.00</AppliedAmount>
<BalanceRemaining>15.00</BalanceRemaining>
<Memo>Test memo goes here.</Memo>
<IsPaid>false</IsPaid>
<IsToBePrinted>false</IsToBePrinted>
<CustomerSalesTaxCodeRef>
<ListID>10000-1211065841</ListID>
<FullName>Tax</FullName>
</CustomerSalesTaxCodeRef>
<InvoiceLineRet>
<TxnLineID>775-1263566752</TxnLineID>
<ItemRef>
<ListID>2B0007-1261281192</ListID>
<FullName>123123</FullName>
</ItemRef>
<Desc>Test item description</Desc>
<Quantity>1</Quantity>
<SalesTaxCodeRef>
<ListID>10000-1211065841</ListID>
<FullName>Tax</FullName>
</SalesTaxCodeRef>
</InvoiceLineRet>
</InvoiceRet>
</InvoiceAddRs>
</QBXMLMsgsRs>
</QBXML>';
    return $xml;
    }

Re: PHP - CodeIgniter Intergration - qbXML issue

I got it working!  I'm not too sure what I did different, aside from cutting down my XML some.

Here is the modified code:

function _addInvoiceRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale) {
        // Grab the data from our MySQL database
        //$arr = mysql_fetch_assoc(mysql_query("SELECT * FROM my_invoices WHERE id = " . (int) $ID));
   
        $xml = '<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="5.0"?>
<QBXML>
    <QBXMLMsgsRq onError="continueOnError">
        <InvoiceAddRq requestID="' . $requestID . '">
            <InvoiceAdd>
                <CustomerRef>
                    <FullName>Wings and Things</FullName>
                </CustomerRef>
                <BillAddress>
                    <Addr1>ConsoliBYTE, LLC</Addr1>
                    <Addr2>134 Stonemill Road</Addr2>
                    <Addr3 />
                    <City>Mansfield</City>
                    <State>CT</State>
                    <PostalCode>06268</PostalCode>
                    <Country>United States</Country>
                </BillAddress>
                <ShipAddress>
                    <Addr1>ConsoliBYTE, LLC</Addr1>
                    <Addr2>Attn: Keith Palmer</Addr2>
                    <Addr3>56 Cowles Road</Addr3>
                    <City>Willington</City>
                    <State>CT</State>
                    <PostalCode>06279</PostalCode>
                    <Country>United States</Country>
                </ShipAddress>
                <Memo>Test memo goes here.</Memo>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>123123</FullName>
                    </ItemRef>
                    <Desc>Test item description</Desc>
                    <Quantity>1.00000</Quantity>
                </InvoiceLineAdd>
            </InvoiceAdd>
        </InvoiceAddRq>
    </QBXMLMsgsRq>
</QBXML>';
       
        return $xml;
    }
   
    function _addInvoiceResponse($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents) {
    /*       
        mysql_query("
            UPDATE
                my_invoices
            SET
                quickbooks_listid = '" . mysql_real_escape_string($idents['ListID']) . "',
                quickbooks_editsequence = '" . mysql_real_escape_string($idents['EditSequence']) . "'
            WHERE
                id = " . (int) $ID);   
    */
    $xml = '<?xml version="1.0" ?>
<QBXML>
    <QBXMLMsgsRs>
    <InvoiceAddRs requestID="' . $requestID . '" statusCode="0" statusSeverity="Info" statusMessage="Status OK">   
        <CustomerRef>
            <FullName>Wings and Things</FullName>
        </CustomerRef>
        </InvoiceAddRs>
        </QBXMLMsgsRs>
        </QBXML>';
    return $xml;
    }

Re: PHP - CodeIgniter Intergration - qbXML issue

Can you set the log to VERBOSE, so that we can see if it's actually succeeding or not?
http://wiki.consolibyte.com/wiki/doku.p … gging_mode


Set to verbose, clear log, queue up, run web connector, and then post the new log.