php - error respons from amazon. Error: "parameter <?x ml version failed a validation check: Extraneous whitespace for input value:

514

Error:

<?xml version="1.0"?>
<ErrorResponse><Error><Type>Sender</Type><Code>InvalidRequest</Code><Message>parameter &lt;?xml version failed a validation check: Extraneous whitespace for input value: ""1.0" encoding="UTF-8"?&gt;
&lt;AmazonEnvelope xsi:noNamespaceSchemaLocation="amzn-envelope.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;Header&gt;
&lt;DocumentVersion&gt;"1.01"&lt;/DocumentVersion&gt;
&lt;MerchantIdentifier&gt;Outdoor_outlet_seller&lt;/MerchantIdentifier&gt;
&lt;/Header&gt;
&lt;MessageType&gt;Product&lt;/MessageType&gt;
&lt;PurgeAndReplace&gt;true&lt;/PurgeAndReplace&gt;
&lt;Message&gt;
&lt;MessageID&gt;736&lt;/MessageID&gt;
&lt;OperationType&gt;Update&lt;/OperationType&gt;
&lt;Product&gt;
&lt;SKU&gt;&lt;![CDATA[120754]]&gt;&lt;/SKU&gt;
&lt;ProductTaxCode&gt;A_GEN_TAX&lt;/ProductTaxCode&gt;
&lt;LaunchDate&gt;&lt;![CDATA[2012-01-26T14:44:51-0800]]&gt;&lt;/LaunchDate&gt;
&lt;DescriptionData&gt;
&lt;Brand&gt;&lt;![CDATA[Liberty Mountain]]&gt;&lt;/Brand&gt;
&lt;Description&gt;This is a description&lt;/Description&gt;
&lt;ItemType&gt;Sports "</Message>
<Detail/>
</Error>
<RequestID>441a3e91-437e-49a4-a232-452984f883da</RequestID>
</ErrorResponse>

Now, I haven't used XML very much but it doesn't seem to complicated. I have been working on this problem for a few days now and I just can't seem to figure it out. I know there has got to be something wrong with my xml I jsut can't pinpoint where.

'<?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>Outdoor_outlet_seller</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>true</PurgeAndReplace>
<Message>
<MessageID>' . rand(1,1000) . '</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU><![CDATA['. $product->getSKU() .']]></SKU>
<ProductTaxCode>A_GEN_TAX</ProductTaxCode>
<LaunchDate><![CDATA[' . date('Y-m-d') . 'T' . date('H:i:sO') . ']]></LaunchDate>
<DescriptionData>
<Brand><![CDATA[' . $brand[$product->getBrandId()] . ']]></Brand>
<Description>This is a description</Description>
<ItemType>Sports & Outdoors</ItemType>
</DescriptionData>
</Message>
</AmazonEnvelope>';

I don't know what is wrong with it, but amzaon doesn't like it and I don't know why. Anyone have similar problems? The amazon Documentation doesn't have anything. I am getting somewhat desperate with this. Thanks for any help :)

55

Answer

Solution:

It means that you have a charactor that the Amazon feed does not like.

Such as &,#,etc.

People are also looking for solutions to the problem: php - MySQL Query to Count Max Consecutive Updates of a Specific Value

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.