XML错误:在Amazon Envelope XML级别格式错误 [英] XML Error: Ill-formed at the Amazon Envelope XML level
问题描述
我正在尝试使Amazon Order Fulfillment API正常运行,但是遇到了问题.当我提交HTTP请求时,响应说它已提交,但是当我查看Amazon中的上传订单相关文件"部分时,它说有一个错误.我收到的错误列在下面:
I am trying to get the Amazon Order Fulfillment API working but I ran into an issue. When I submit the HTTP request the response says it was submitted however, when I look at the 'Upload Order Related File' section in Amazon it says there was an error. The error I get is listed below:
The XML you submitted is ill-formed at the Amazon Envelope XML level at (or near) line 2, column 18.
这是我的XML请求
<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xsi:noNamespaceSchemaLocation="amzn-envelope.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>M_MySite_1234567</MerchantIdentifier>
</Header>
<MessageType>OrderFulfillment</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderFulfillment>
<AmazonOrderID>112-0023859-8293023</AmazonOrderID>
<MerchantFulfillmentID>789456123545646312</MerchantFulfillmentID>
<FulfillmentDate>2013-01-14T10:42:33</FulfillmentDate>
<FulfillmentData>
<CarrierCode>UPS</CarrierCode>
<ShippingMethod>UPS Ground</ShippingMethod>
<ShipperTrackingNumber>1Z19Y92EYW42152145</ShipperTrackingNumber>
</FulfillmentData>
<Item>
<MerchantFulfillmentItemID>123456700000074</MerchantFulfillmentItemID>
<Quantity>1</Quantity>
</Item>
</OrderFulfillment>
</Message>
</AmazonEnvelope>
我不确定我在做什么错.我正在运行ColdFusion 9.
I'm not sure exactly what I am doing wrong. I am running ColdFusion 9.
任何帮助将不胜感激.
谢谢!
推荐答案
我能够找出此发布的问题.似乎失败的原因是因为所生成的XML在
I was able to figure out the problem for this posting. Seems the reason it was failing was because the XML that was being produced added a line break before the
<?xml version="1.0" encoding="UTF-8"?>
这导致XML在Amazon方面失败.
This caused the XML to fail on Amazon's side.
这篇关于XML错误:在Amazon Envelope XML级别格式错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!