gpt4 book ai didi

quickbooks - 销售订单中的多个订单在 qbxml 中添加请求

转载 作者:行者123 更新时间:2023-12-02 01:03:48 27 4
gpt4 key购买 nike

我正在尝试使用 Quickbooks Webconnector 将销售订单添加到 quickbooks。当我添加一个订单时它已成功添加,但是当我尝试在单个 qbxml 中添加多个订单时,quickbooks 会抛出以下错误。

"message="QuickBooks 在解析提供的 XML 文本流时发现错误。"

以下是发送的请求QBXML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?qbxml version="8.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<SalesOrderAddRq>
<SalesOrderAdd defMacro="MACROTYPE">
<CustomerRef>
<FullName>Amazon.com.nvdc, Inc</FullName>
</CustomerRef>
<TxnDate>2014-07-29</TxnDate>
<BillAddress>
<Addr1>RNO1</Addr1>
<City>Fernley</City>
<State>NV</State>
<PostalCode>89408-8903</PostalCode>
<Country>US</Country>
</BillAddress>
<PONumber>TST00003</PONumber>
<DueDate>2014-07-29</DueDate>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLU</FullName>
</ItemRef>
<Desc>ES-10BLU</Desc>
<Quantity>3</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUINVALID</FullName>
</ItemRef>
<Desc>ES-10BLUINVALID</Desc>
<Quantity>4</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUDISC</FullName>
</ItemRef>
<Desc>ES-10BLUDISC</Desc>
<Quantity>5</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
</SalesOrderAdd>
<SalesOrderAdd defMacro="MACROTYPE">
<CustomerRef>
<FullName>Amazon.com.nvdc, Inc</FullName>
</CustomerRef>
<TxnDate>2014-07-29</TxnDate>
<BillAddress>
<Addr1>RNO1</Addr1>
<City>Fernley</City>
<State>NV</State>
<PostalCode>89408-8903</PostalCode>
<Country>US</Country>
</BillAddress>
<PONumber>TST00004</PONumber>
<DueDate>2014-07-29</DueDate>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLU</FullName>
</ItemRef>
<Desc>ES-10BLU</Desc>
<Quantity>3</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUINVALID</FullName>
</ItemRef>
<Desc>ES-10BLUINVALID</Desc>
<Quantity>4</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUDISC</FullName>
</ItemRef>
<Desc>ES-10BLUDISC</Desc>
<Quantity>5</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
</SalesOrderAdd>
<SalesOrderAdd defMacro="MACROTYPE">
<CustomerRef>
<FullName>Amazon.com.nvdc, Inc</FullName>
</CustomerRef>
<TxnDate>2014-07-29</TxnDate>
<BillAddress>
<Addr1>RNO1</Addr1>
<City>Fernley</City>
<State>NV</State>
<PostalCode>89408-8903</PostalCode>
<Country>US</Country>
</BillAddress>
<PONumber>TST00005</PONumber>
<DueDate>2014-07-29</DueDate>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLU</FullName>
</ItemRef>
<Desc>ES-10BLU</Desc>
<Quantity>3</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUINVALID</FullName>
</ItemRef>
<Desc>ES-10BLUINVALID</Desc>
<Quantity>4</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
<SalesOrderLineAdd>
<ItemRef>
<FullName>ES-10BLUDISC</FullName>
</ItemRef>
<Desc>ES-10BLUDISC</Desc>
<Quantity>5</Quantity>
<UnitOfMeasure>EA</UnitOfMeasure>
<Rate>100.0</Rate>
</SalesOrderLineAdd>
</SalesOrderAdd>
</SalesOrderAddRq>
</QBXMLMsgsRq>
</QBXML>

quickbooks 是否支持在单个 qbxml 请求中发送多个销售订单,或者它在 1 个请求中只接受一个订单?

最佳答案

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

QuickBooks found an error when parsing the provided XML text stream.

您应该做的第一件事是通过 QuickBooks SDK 中包含的 XML Validator 工具运行您的 XML。

如果你这样做,你会得到这个:

Line: 48
LinePos: 49
Src Text: <SalesOrderAdd defMacro="MACROTYPE">
Reason: Element content is invalid according to the DTD/Schema.
Expecting: IncludeRetElement.

这基本上是在告诉您这个标签:

<SalesOrderAdd

在这一行:

Line: 48

不正确。

这是不正确的,因为您没有关闭 </SalesOrderAddRq>打开新标签之前 <SalesOrderAdd>标签。你应该在第 48 行附近有这个:

    </SalesOrderAdd>
</SalesOrderAddRq> <!-- close the first request we're making... -->

<SalesOrderAddRq> <!-- ... before starting our second request -->
<SalesOrderAdd>

关于quickbooks - 销售订单中的多个订单在 qbxml 中添加请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25151883/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com