logo
down
shadow

Quickbooks Web Connector suddenly throws 0x80040400 error


Quickbooks Web Connector suddenly throws 0x80040400 error

By : user2954145
Date : November 22 2020, 01:01 AM
This might help you I discovered the problem. Unfortunately, no one would have been able to help as I had to remove sensitive information from the example, which is where the problem was.
The issue was that in the Memo element, there was a unicode character (–). This caused the XML to be invalid, despite the fact that it passes when run through the qbValidator tool. Removing the character allowed the sales order to be added correctly.
code :


Share : facebook icon twitter icon
Using consolibyte QuickBooks PHP framework - cannot import all employees 0x80040400 error

Using consolibyte QuickBooks PHP framework - cannot import all employees 0x80040400 error


By : manish gupta
Date : March 29 2020, 07:55 AM
To fix this issue Please refer to the documentation:
https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
code :
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<EmployeeQueryRq metaData="ENUMTYPE">
0x80040400 error of an error when parsing the provided xml text stream
QuickBooks found an error when parsing the provided XML text stream
0x80040400: QuickBooks found an error when parsing the provided XML text stream

0x80040400: QuickBooks found an error when parsing the provided XML text stream


By : Peter
Date : March 29 2020, 07:55 AM
wish of those help I am using consobyte PHP SDK for QuickBooks Desktop and when I try to add Non Inventory Item, it throws the error-0x80040400: QuickBooks found an error when parsing the provided XML text stream. , Fix this:
code :
   <PurchaseDesc>Apple Watch (not Sport)</PurchaseDesc>
   <PurchaseDesc>50.00</PurchaseDesc>
Line: 15
LinePos: 25
Src Text: <PurchaseDesc>50.00</PurchaseDesc>
Reason: Element content is invalid according to the DTD/Schema.
Expecting: PurchaseCost, PurchaseTaxCodeRef, ExpenseAccountRef, PrefVendorRef.
Editing QuickBooks for Windows inventory quantity on hand with QuickBooks PHP Dev Kit / QuickBooks Web Connector

Editing QuickBooks for Windows inventory quantity on hand with QuickBooks PHP Dev Kit / QuickBooks Web Connector


By : PitBee
Date : March 29 2020, 07:55 AM
wish helps you SQL Mirror for Inventory Adjustments:
First, the usual disclaimer - the SQL mirror stuff is beta, so don't expect 100% functionality (as indicated in the release notes). With that said...
code :
$sql = "UPDATE qb_iteminventory SET QuantityOnHand='" . $update[1] . "' WHERE qbsql_id='" . $update[0] . "'";
INSERT INTO `qb_inventoryadjustment` ( `TxnID`, `TimeCreated`, `TimeModified`,  `Account_FullName`, `TxnDate`, `RefNumber`,  `Memo`, `qbsql_discov_datetime`, `qbsql_resync_datetime`, `qbsql_modify_timestamp` )
VALUES ( 'TxnID-1234', now(), now(),  'Inventory Adjustments', '2016-12-23', '1234', 'Test adjustment', NULL, NULL, now() );

INSERT INTO `qb_inventoryadjustment_inventoryadjustmentline` ( `InventoryAdjustment_TxnID`, `SortOrder`, `TxnLineID`, `NewQuantity` )
VALUES ( 'TxnID-1234', '0', 'ABCD-1234', '10' );
$ops = array(
   ... 
   QUICKBOOKS_OBJECT_INVENTORYADJUSTMENT
   ...
   );
// Require the framework
require_once '../../QuickBooks.php';

// A username and password you'll use in: 
//  a) Your .QWC file
//  b) The Web Connector
//  c) The QuickBooks framework
$user = 'quickbooks';
$pass = 'password';

// Map QuickBooks actions to handler functions
$map = array(
    // ...
    );

// This is entirely optional, use it to trigger actions when an error is returned by QuickBooks
$errmap = array();

// An array of callback hooks
$hooks = array();

// Logging level
$log_level = QUICKBOOKS_LOG_DEVELOP;        // Use this level until you're sure everything works!!!

// * MAKE SURE YOU CHANGE THE DATABASE CONNECTION STRING BELOW TO A VALID MYSQL USERNAME/PASSWORD/HOSTNAME *
$dsn = 'mysql://root:root@localhost/quickbooks_server';

if (!QuickBooks_Utilities::initialized($dsn))
{
    // Initialize creates the neccessary database schema for queueing up requests and logging
    QuickBooks_Utilities::initialize($dsn);

    // This creates a username and password which is used by the Web Connector to authenticate
    QuickBooks_Utilities::createUser($dsn, $user, $pass);
}

// Create a new server and tell it to handle the requests
$Server = new QuickBooks_WebConnector_Server($dsn, $map, $errmap, $hooks, $log_level);
$response = $Server->handle(true, true);
/**
 * Generate a qbXML response to add a particular customer to QuickBooks
 * 
 * @return string                           A valid qbXML request
 */
function _quickbooks_inventoryadjustment_add_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale, $callback_config)
{
    $Driver = QuickBooks_Driver_Singleton::getInstance();

    $errnum = null;
    $errmsg = null;
    $data = $Driver->fetch($Driver->query("SELECT * FROM qb_inventoryadjustment WHERE qbsql_id = %d", $errnum, $errmsg, 0, 1, array( $ID )));

    $res_lines = $Driver->query("SELECT * FROM qb_inventoryadjustment_inventoryadjustmentline WHERE InventoryAdjustment_TxnID = '%s' ORDER BY SortOrder ASC", $errnum, $errmsg, null, null, array( $data['TxnID'] ));

    foreach ($data as $key => $value)
    {
        //$data[$key] = QuickBooks_Cast::cast(QUICKBOOKS_OBJECT_CUSTOMER, str_replace('_', ' ', $key), $value);
    }

    $str_action = 'InventoryAdjustmentAdd';
    $TxnID = '';
    $EditSequence = '';
    if ($action == 'InventoryAdjustmentMod')
    {
        $str_action = 'InventoryAdjustmentMod';
        $TxnID = '<TxnID>' . $data['TxnID'] . '</TxnID>';
        $EditSequence = '<EditSequence>' . $data['EditSequence'] . '</EditSequence>';
    }

    $xml = '<?xml version="1.0" encoding="utf-8"?>
        <?qbxml version="' . $version . '"?>
        <QBXML>
            <QBXMLMsgsRq onError="stopOnError">
                <' . $str_action . 'Rq requestID="' . $requestID . '">
                    <' . $str_action . '>
                        ' . $TxnID . '
                        ' . $EditSequence . '

                        <AccountRef>
                            <FullName>' . $data['Account_FullName'] . '</FullName>
                        </AccountRef>

                        <TxnDate>' . $data['TxnDate'] . '</TxnDate>
                        <!--<RefNumber>' . $data['RefNumber'] . '</RefNumber>-->

                        <Memo>' . $data['Memo'] . '</Memo>
                        ';

    while ($line = $Driver->fetch($res_lines))
    {
        $xml .= '
                        <InventoryAdjustmentLineAdd>
                            <ItemRef>';

        if ($line['Item_ListID'])
        {
            $xml .= '
                                <ListID>' . $line['Item_ListID'] . '</ListID>';
        }
        else
        {
            $xml .= '
                                <FullName>' . $line['Item_FullName'] . '</FullName>';
        }

        $xml .= '
                            </ItemRef>

                            <QuantityAdjustment>';

        if ($line['QuantityDifference'])
        {
            $xml .= '
                                <QuantityDifference>' . $line['QuantityDifference'] . '</QuantityDifference>';
        }
        else
        {
            $xml .= '
                                <NewQuantity>' . $line['NewQuantity'] . '</NewQuantity>';
        }

        $xml .= '
                            </QuantityAdjustment>
                        </InventoryAdjustmentLineAdd>
                ';
    }

    $xml .= '

                    </' . $str_action . '>
                </' . $str_action . 'Rq>
            </QBXMLMsgsRq>
        </QBXML>';

    return $xml;
}

/**
 * Receive a response from QuickBooks 
 */
function _quickbooks_inventoryadjustment_add_response($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents, $callback_config)
{   
    $Driver = QuickBooks_Driver_Singleton::getInstance();

    $datetime = date('Y-m-d H:i:s');

    $errnum = null;
    $errmsg = null;
    $data = $Driver->fetch($Driver->query("SELECT * FROM qb_inventoryadjustment WHERE qbsql_id = %d", $errnum, $errmsg, 0, 1, array( $ID )));

    if ($data)
    {
        // Get the existing lines 
        $res_lines = $Driver->query("SELECT * FROM qb_inventoryadjustment_inventoryadjustmentline WHERE InventoryAdjustment_TxnID = '%s' ORDER BY qbsql_id ASC ", $errnum, $errmsg, null, null, array( $data['TxnID'] ));

        // Update ListID/EditSequence
        $errnum = null;
        $errmsg = null;
        $Driver->query("
            UPDATE 
                qb_inventoryadjustment
            SET 
                TxnID = '%s', 
                EditSequence = '%s', 
                TimeCreated = '%s', 
                TimeModified = '%s', 
                RefNumber = '%s', 
                qbsql_discov_datetime = '%s', 
                qbsql_resync_datetime = '%s', 
                qbsql_modify_timestamp = '%s'
            WHERE 
                qbsql_id = %d ", $errnum, $errmsg, 0, 1, 
            array( 
                $idents['TxnID'], 
                $idents['EditSequence'], 
                date('Y-m-d H:i:s'), 
                date('Y-m-d H:i:s'), 
                $idents['RefNumber'],
                $datetime, 
                $datetime, 
                $datetime,
                $ID ));

        // Parse the XML we got back 
        // Import all of the records
        $errnum = 0;
        $errmsg = '';
        $Parser = new QuickBooks_XML_Parser($xml);
        if ($Doc = $Parser->parse($errnum, $errmsg))
        {
            $Root = $Doc->getRoot();
            $List = $Root->getChildAt('QBXML/QBXMLMsgsRs/InventoryAdjustmentAddRs');

            $TxnLineIDs = array();

            foreach ($List->children() as $InventoryAdjustment)
            {
                // Process the line items
                foreach ($InventoryAdjustment->children() as $Child)
                {
                    if ($Child->name() == 'InventoryAdjustmentLineRet')
                    {
                        // Store the TxnLineID
                        $TxnLineIDs[] = $Child->getChildDataAt('InventoryAdjustmentLineRet TxnLineID');
                    }
                }
            }

            reset($TxnLineIDs);
            while ($line = $Driver->fetch($res_lines))
            {
                $TxnLineID = current($TxnLineIDs);
                next($TxnLineIDs);

                // Update each line item with the TxnID and the TxnLineID 
                $Driver->query("
                    UPDATE 
                        qb_inventoryadjustment_inventoryadjustmentline
                    SET 
                        InventoryAdjustment_TxnID = '%s', 
                        TxnLineID = '%s', 
                        qbsql_discov_datetime = '%s', 
                        qbsql_resync_datetime = '%s', 
                        qbsql_modify_timestamp = '%s'
                    WHERE 
                        qbsql_id = %d ", $errnum, $errmsg, null, null,  
                    array( 
                        $idents['TxnID'], 
                        $TxnLineID, 
                        $datetime, 
                        $datetime, 
                        $datetime,
                        $line['qbsql_id'] ));
            }
        }

    }
}
$Queue->enqueue(QUICKBOOKS_ADD_INVENTORYADJUSTMENT, $ID);
QuickBooks Web Connector: "QuickBooks found an error when parsing the provided XML text stream" but qb*XML Val

QuickBooks Web Connector: "QuickBooks found an error when parsing the provided XML text stream" but qb*XML Val


By : arya
Date : March 29 2020, 07:55 AM
I hope this helps . QuickBooks Web Connector is sending the QuickBooks found an error when parsing the provided XML text stream. message to my receiveResponseXML method even though my xml checks out in the qb*XML Validator. I have included the authenticate and sendRequestXML methods from my QBTalker class below (other required methods are also in the class; QB Web Connector talks to clientVersion, authenticate, sendRequestXML in that order before sending the hresult value 0x80040400 and the message value QuickBooks found an error when parsing the provided XML text stream. to receiveResponseXML): , Although changing
code :
@srpc(String, String, String, String, UnsignedInteger, UnsignedInteger, _returns=String)
@srpc(String, String, String, String, UnsignedInteger, UnsignedInteger, _returns=AnyXml)
@srpc(String, String, String, String, UnsignedInteger, UnsignedInteger, _returns=AnyXml)
@srpc(String, String, String, String, UnsignedInteger, UnsignedInteger, _returns=Unicode)
root = lxml.etree.fromstring(xml)
return lxml.etree.tostring(root)
#root = lxml.etree.fromstring(xml)
#return lxml.etree.tostring(root)
return xml
app = Application([QBTalker], tns='http://developer.intuit.com/',
        in_protocol=Soap11(validator='soft'),
        out_protocol=Soap11(),
    )
app = Application([QBTalker], tns='http://developer.intuit.com/',
        in_protocol=Soap11(validator='soft'),
        out_protocol=Soap11(encoding='UTF-8', xml_declaration=True),
    )
Why Quickbooks keeps crashing while syncing data via QuickBooks Web Connector when the QuickBooks Company file is not op

Why Quickbooks keeps crashing while syncing data via QuickBooks Web Connector when the QuickBooks Company file is not op


By : Pranav Jagtap
Date : March 29 2020, 07:55 AM
Any of those help In Log its show "Could not find or create an instance of QuickBooks".
Here are things to look at if you are getting a "Could not start QuickBooks" error message.
Related Posts Related Posts :
  • How to add Smarty templating engine to CodeIgniters 3 framework?
  • Am I maxing out possible data insert
  • Redirect to homepage without changing address bar URL
  • What is the best user-Id Value for a MySql "users" table
  • PHP $_COOKIE is only available in one directory
  • php regular expressions documantation
  • cannot import too large sql file to mysql
  • not getting appilcation/json in content-type in header
  • Only the first data display from my database but other shows but not on a table
  • Is it possible to have a print button link as the content of the mail
  • how to extract full mail address in imap php
  • Alternative to output buffering to put eval'd code into a variable
  • how to run wordpress php snippet mysql update command from ssh and/ultimately cron
  • how to get xml tag by name
  • ModSecurity maximum post limits (PCRE limit errors)
  • Call controller/action in event listener
  • How to improve performance of contacting WebService?
  • PHP nest variable in echoed string that contains a HTML tag in the end
  • Multiple Ajax request for PHP framework
  • Debug Info from Moodle Plugin
  • passing variables through page
  • Passing PHP $result data to Javascript
  • cakePHP File Download was not found or not readable
  • batch waiting until script finishes
  • PHP variables and anchors in URL
  • php eTag generation using php
  • How to check whether the array is an Integer or Not?
  • Is it possible to install Doctrine without PEAR or Composer? If so, how?
  • Call view script of (parent) Abstract controller Zend
  • Curl PHP cannot display amazon
  • Symfony, getters and setters vs magic methods
  • Using 'continue' PHP instruction outside the loop
  • AJAX POST return data not appearing
  • Can I query relations using an INNER JOIN instead of two queries in Eloquent?
  • Looping through dynamic form fields and inserting into database
  • My php code can't select mysql auto_increment value
  • Store Angularjs form data in database using php
  • I want to run my sh file continuously even if I close my Putty connection
  • file_get_contents equivalent for gzipped files
  • Include PHP file with jQuery
  • php curl headers do not return from website?
  • How to find out, if facebook ID is a user, group or page
  • Connect webhost database to android database
  • preg_match get div content with class
  • Upload multiple files in Laravel 4
  • Count array numbers in multidimensional array
  • PHP Date diff with a difference
  • Search Customer by custom field in Netsuite
  • Is it possible to hide/encode/encrypt php source code and let others have the system?
  • list items to be displayed using php code and array
  • check if row exists mysqli
  • PHP errors loading MySQL
  • setup PostgreSQL with Laravel in MAMP
  • PHP - CodeIgniter Notifications
  • Encrypting a password column in a SQL database
  • New to PHP, trying to extract information from another website
  • JavaScript AmChart to Image for Email
  • Is javascript validation enough to keep my forms secure?
  • Regex extract variables from [shortcode]
  • Download a .mp3 link and save it to computer with PHP
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org