我正在尝试使用 Amazon MWS(在 php 中)在 Amazon.de 市场上上传产品提要,但收到错误消息“您提交的 XML 在第 8 行(或附近)第 18 列的 Amazon Envelope XML 级别格式不正确” .此外,当尝试通过暂存器 (https://mws.amazonservices.de/scratchpad/index.html) 上传相同的提要时,它会被上传。
这是我的 XML 请求:
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>M_RUPESH_123456</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>false</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>p-24862</SKU>
<Condition>
<ConditionType>New</ConditionType>
</Condition>
<DescriptionData>
<Title><![CDATA[2012-13 Chile Puma Home Football Shirt]]></Title>
<Brand>Puma</Brand>
<Description>description</Description>
<BulletPoint>football</BulletPoint>
<Manufacturer>Puma</Manufacturer>
<SearchTerms>football</SearchTerms>
<RecommendedBrowseNode>324078011</RecommendedBrowseNode>
<TSDLanguage>English</TSDLanguage>
</DescriptionData>
<ProductData>
<Sports>
<ProductType>SportingGoods</ProductType>
<VariationData>
<Parentage><![CDATA[parent]]></Parentage>
<VariationTheme>Size</VariationTheme>
</VariationData>
</Sports>
</ProductData>
</Product>
</Message>
<Message>
<MessageID>2</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>p-24862-Sma</SKU>
<StandardProductID>
<Type>UPC</Type>
<Value>4051412990195</Value>
</StandardProductID>
<Condition>
<ConditionType>New</ConditionType>
</Condition>
<DescriptionData>
<Title><![CDATA[2012-13 Chile Puma Home Football Shirt]]></Title>
<Brand>Puma</Brand>
<Description>description</Description>
<BulletPoint>football</BulletPoint>
<Manufacturer>Puma</Manufacturer>
<SearchTerms>football</SearchTerms>
<RecommendedBrowseNode>324078011</RecommendedBrowseNode>
<TSDLanguage>English</TSDLanguage>
</DescriptionData>
<ProductData>
<Sports>
<ProductType>SportingGoods</ProductType>
<VariationData>
<Parentage><![CDATA[child]]></Parentage>
<VariationTheme>Size</VariationTheme>
<Size>Small Adults</Size>
</VariationData>
</Sports>
</ProductData>
</Product>
</Message>
</AmazonEnvelope>
我不确定我做错了什么。
任何帮助将不胜感激。
谢谢
您的 XML 不仅格式正确,而且我还根据我的亚马逊 XSD 副本成功验证了它。由于通过 ScratchPad 提交相同的提要有效,我怀疑问题出在其他地方,与您收到的错误消息完全无关(这不是我第一次看到亚马逊的错误消息完全消失)。
您使用的是亚马逊的示例 PHP 库还是您自己的代码?
尝试在提供 XML 版本和编码详细信息的第一行添加以下内容
<?xml version="1.0" encoding="utf-8"?>