使用 consolibyte 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>

这是生成它的代码(我正在使用基于他们的示例之一的迭代器将 return 分成批次 - 我在导入的每个部分都使用了完全相同的格式- 它适用于所有其他对象)

    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;
}

求助!

请参考文档:

这表示 iterators 不支持员工。

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

如果问题仍然存在,请 post logs/Web 连接器中显示的实际错误消息。 Copy/paste。

不是 QuickBooks 产生的错误:

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

您可能看到的是:

QuickBooks found an error when parsing the provided XML text stream