本文介绍了0x80040400:QuickBooks 在解析提供的 XML 文本流时发现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

<?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>

推荐答案

解决这个问题:

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

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

Anytime you get this error message:

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

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

The first thing you should do is look at your XML closely. And then run it through the XML Validator tool included with the QuickBooks SDK. It tells you exactly what's wrong:

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.

这篇关于0x80040400:QuickBooks 在解析提供的 XML 文本流时发现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 23:56