【问题标题】:0x80040400: QuickBooks found an error when parsing the provided XML text stream0x80040400:QuickBooks 在解析提供的 XML 文本流时发现错误
【发布时间】:2016-08-31 15:27:44
【问题描述】:

我正在使用适用于 QuickBooks Desktop 的 consobyte PHP SDK,当我尝试添加非库存项目时,它会抛出错误 0x80040400:QuickBooks 在解析提供的 XML 文本流时发现错误。

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <ItemNonInventoryAddRq requestID="38">
      <ItemNonInventoryAdd>
        <Name>46428</Name>
        <SalesAndPurchase>
          <SalesDesc>Apple Watch (not Sport)</SalesDesc>
          <SalesPrice>50.00</SalesPrice>
          <IncomeAccountRef>
            <FullName>Merchandise Sales</FullName>
          </IncomeAccountRef>
          <PurchaseDesc>Apple Watch (not Sport)</PurchaseDesc>
          <PurchaseDesc>50.00</PurchaseDesc>
          <ExpenseAccountRef>
            <FullName>Repairs and Maintenance</FullName>
          </ExpenseAccountRef>
        </SalesAndPurchase>
      </ItemNonInventoryAdd>
    </ItemNonInventoryAddRq>
  </QBXMLMsgsRq>
</QBXML>

【问题讨论】:

    标签: php quickbooks


    【解决方案1】:

    解决这个问题:

       <PurchaseDesc>Apple Watch (not Sport)</PurchaseDesc>
       <PurchaseDesc>50.00</PurchaseDesc>
    

    每当您收到此错误消息时:

    0x80040400:QuickBooks 在解析提供的 XML 文本流时发现错误。

    您应该做的第一件事是仔细查看您的 XML。然后通过 QuickBooks SDK 附带的XML Validator 工具运行它。它准确地告诉你出了什么问题:

    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.
    

    【讨论】:

    • 非常感谢。你太棒了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多