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

时间:2016-07-20 16:10:05

标签: php quickbooks

我必须遗漏一些东西,因为我查询所有供应商,客户和物品都没有问题,但员工让我头疼。我的文件永远不会进入导入响应,因为它在解析提供的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;
}

HELP!

1 个答案:

答案 0 :(得分:0)

请参阅文档:

表示员工不支持iterators

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

如果仍有问题,请发布日志/ Web连接器中显示的实际错误消息。复制粘贴。

这是 QuickBooks产生的错误:

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

您可能会看到的是:

QuickBooks found an error when parsing the provided XML text stream