使用Consolbyte QuickBooks PHP框架-无法导入所有员工0x80040400错误


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

我一定遗漏了什么,因为我在查询所有供应商、客户和物品时没有遇到任何问题,但员工让我头疼。我的文件从未到达导入响应,因为它在解析所提供的xml文本流时抛出了一个0x80040400错误。这就是确切的xml流:

<?xml version="1.0" encoding="utf-8"?>
    <?qbxml version="13.0"?>
    <QBXML>
        <QBXMLMsgsRq onError="continueOnError">
            <EmployeeQueryRq  iterator="Start"   requestID="249">
                                <MaxReturned>10</MaxReturned>
                                        <ActiveStatus>All</ActiveStatus>
                                        <FromModifiedDate>1983-01-02T12:01:01</FromModifiedDate>
                                        <OwnerID>0</OwnerID>
            </EmployeeQueryRq>  
        </QBXMLMsgsRq>
    </QBXML>

这就是产生它的代码(我使用了一个基于他们的一个例子的迭代器将返回分解为批-我在导入的每个部分都使用了完全相同的格式-它适用于所有其他对象)

    function _quickbooks_employee_import_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale)
{
    // Iterator support (break the result set into small chunks)
    $attr_iteratorID = '';
    $attr_iterator = ' iterator="Start" ';
    if (empty($extra['iteratorID']))
    {
        // This is the first request in a new batch
        $last = _quickbooks_get_last_run($user, $action);
        _quickbooks_set_last_run($user, $action);           
// Update      the     last run time to NOW()
    // Set the current run to $last
    _quickbooks_set_current_run($user, $action, $last);
}
else
{
    // This is a continuation of a batch
    $attr_iteratorID = ' iteratorID="' . $extra['iteratorID'] . '" ';
    $attr_iterator = ' iterator="Continue" ';
    $last = _quickbooks_get_current_run($user, $action);
}
// Build the request
$xml = '<?xml version="1.0" encoding="utf-8"?>
    <?qbxml version="' . $version . '"?>
    <QBXML>
        <QBXMLMsgsRq onError="continueOnError">
            <EmployeeQueryRq ' . $attr_iterator . ' ' . $attr_iteratorID . ' requestID="' . $requestID . '">
                                <MaxReturned>' . QB_QUICKBOOKS_MAX_RETURNED . '</MaxReturned>
                                        <ActiveStatus>All</ActiveStatus>
                                        <FromModifiedDate>' . $last . '</FromModifiedDate>
                                        <OwnerID>0</OwnerID>
            </EmployeeQueryRq>  
        </QBXMLMsgsRq>
    </QBXML>';
    QuickBooks_Utilities::log(QB_QUICKBOOKS_DSN, $xml);
return $xml;
}

救命!

请参阅文档:

  • https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html

这表示员工不支持iterators

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<EmployeeQueryRq metaData="ENUMTYPE">

如果您仍然遇到问题,请发布日志/Web Connector中显示的实际错误消息。复制/粘贴。

这是而不是QuickBooks产生的错误:

0x80040400 error of an error when parsing the provided xml text stream

你可能看到的是:

QuickBooks found an error when parsing the provided XML text stream