上传亚马逊产品变体

问题描述 投票:0回答:1

我正在尝试使用亚马逊 MWS 上传产品。我的代码如下:

<Message>
    <MessageID>3933</MessageID>
    <OperationType>PartialUpdate</OperationType>
    <Product>
        <SKU>EL01080-CC</SKU> 
        <StandardProductID>
            <Type>EAN</Type>
            <Value>8435405918599</Value>
        </StandardProductID>          
        <Condition>
            <ConditionType>New</ConditionType>
        </Condition>
        <DescriptionData>
            <Title><![CDATA[Power Hair X5 Maquillaje capilar indetectable para calvicie. Bote de 25g , color castaño claro]]></Title> 
            <Brand><![CDATA[PowerHair]]></Brand> 
            <Description><![CDATA[Gama de colores...]]></Description> 
            <Manufacturer><![CDATA[PowerHair]]></Manufacturer>
            <MfrPartNumber><![CDATA[EL01080-CC]]></MfrPartNumber>
            <RecommendedBrowseNode>2928542031</RecommendedBrowseNode>
        </DescriptionData>
        <ProductData><Home>
                <Parentage>child</Parentage>
                <VariationData>
                    <VariationTheme>Size-Color</VariationTheme>
                </VariationData>
                <Size>Medium</Size>
                <Color>Dark Grey Melange</Color>
            </Home></ProductData>
    </Product>
</Message>

我收到以下错误:

XML Parsing Error at Line 145520, Column 11: cvc-complex-type.2.4.a: Invalid content was found starting with element &"Size&". One of &"{BatteryDescription, CanShipInOriginalContainer, CountryAsLabeled, CountryOfOrigin, CountryProducedIn, ImportDesignation, FurDescription, IdentityPackageType, IncludedComponents, FabricType, PatternName, SeatHeight, SpecialFeatures, StyleName, Occasion, MatteStyle, DisplayLength, DisplayWidth, DisplayHeight, DisplayDepth, DisplayDiameter, DisplayVolume, DisplayWeight, ItemPackageQuantity, ManufacturerWarrantyDescription, Volume, VolumeCapacity, Material, ThreadCount, NumberOfPieces, SafetyWarning, AwardsWon, BatteryAverageLife, BatteryAverageLifeStandby, BatteryChargeTime, BatteryTypeLithiumIon, BatteryTypeLithiumMetal, LithiumBatteryEnergyContent, LithiumBatteryPackaging, LithiumBatteryVoltage, LithiumBatteryWeight, MfgWarrantyDescriptionLabor, MfgWarrantyDescriptionParts, MfgWarrantyDescriptionType, NumberOfItemsInPackage, NumberOfLithiumIonCells, NumberOfLithiumMetalCells, PowerSourceType, RegionOfOrigin, SellerWarrantyDescription, SizeMap, Warnings, Wattage, Length, Width, Height, Depth, Diameter, Weight, Spread, SunlightExposure, MoistureNeeds, USDAHardinessZone, SunsetClimateZone, NumberOfSets}&" is expected.

如果我删除 ProducData 标签,我可以毫无问题地上传它。我怎样才能用这个变体上传它?我找不到有关如何操作的任何适当文档。我在尺寸和颜色标签方面遇到问题。

xml amazon-mws
1个回答
4
投票

您的 XML 未通过验证。

<Size>
<Color>
标签需要嵌套在
<VariationData>
中。以下是您的 XML 的副本,其中添加了
<AmazonEnvelope>
、其他标头数据并移动了提到的标签:

<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
    <Header>
        <DocumentVersion>1.01</DocumentVersion>
        <MerchantIdentifier>YOURMERCHANTIDENTIFIER</MerchantIdentifier>
    </Header>
    <MessageType>Product</MessageType>
    <PurgeAndReplace>false</PurgeAndReplace>
    <Message>
        <MessageID>3933</MessageID>
        <OperationType>PartialUpdate</OperationType>
        <Product>
            <SKU>EL01080-CC</SKU> 
            <StandardProductID>
                <Type>EAN</Type>
                <Value>8435405918599</Value>
            </StandardProductID>          
            <Condition>
                <ConditionType>New</ConditionType>
            </Condition>
            <DescriptionData>
                <Title><![CDATA[Power Hair X5 Maquillaje capilar indetectable para calvicie. Bote de 25g , color castaño claro]]></Title> 
                <Brand><![CDATA[PowerHair]]></Brand> 
                <Description><![CDATA[Gama de colores...]]></Description> 
                <Manufacturer><![CDATA[PowerHair]]></Manufacturer>
                <MfrPartNumber><![CDATA[EL01080-CC]]></MfrPartNumber>
                <RecommendedBrowseNode>2928542031</RecommendedBrowseNode>
            </DescriptionData>
            <ProductData>
                <Home>
                    <Parentage>child</Parentage>
                    <VariationData>
                        <VariationTheme>Size-Color</VariationTheme>
                        <Size>Medium</Size>
                        <Color>Dark Grey Melange</Color>
                    </VariationData>
                </Home>
            </ProductData>
        </Product>
    </Message>
</AmazonEnvelope>

此修改后的 XML 文件针对 XSD 架构进行验证。

© www.soinside.com 2019 - 2024. All rights reserved.