XML Error: Ill-formed at the Amazon Envelope XML level

雨燕双飞 提交于 2019-12-11 09:37:50

问题


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.

Here is my XML request

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

I'm not sure exactly what I am doing wrong. I am running ColdFusion 9.

Any help would be appreciated.

Thanks!


回答1:


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

This caused the XML to fail on Amazon's side.



来源:https://stackoverflow.com/questions/14341287/xml-error-ill-formed-at-the-amazon-envelope-xml-level

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!