2013-07-18 32 views
0

我想通過使用亞馬遜MWS(在php中)上傳Amazon.de市場上的產品訂閱源,但遇到錯誤「您在第8行第18列的Amazon Envelope XML級別上提交的XML格式不正確。此外,當嘗試通過暫存器(https://mws.amazonservices.de/scratchpad/index.html)上傳相同的Feed時,它會上傳。XML錯誤:亞馬遜信封XML級別在(或接近)第8行第18列的格式錯誤

這裏是我的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> 

我不知道到底是什麼,我做錯了。

任何幫助,將不勝感激。

感謝

回答

1

不僅合式您的XML,我也成功驗證了其對我的亞馬遜的XSD文件的副本。由於通過ScratchPad工作提交相同的Feed,我懷疑問題在別處,而且根本與您收到的錯誤消息有關(這不是我第一次看到Amazon的錯誤信息完全關閉)。

您使用的是Amazon的示例PHP庫還是您自己的代碼?

+0

由於添加以下內容。亞馬遜很挑剔,所以經常比較你的XML和文檔中的示例是最好的選擇。 – IcedDante

1

嘗試在第一行給出XML版本和編碼的細節,讓我知道亞馬遜便籤

<?xml version="1.0" encoding="utf-8"?>