我正在使用ColdFusion通过其Marketplace Api版本3.2将商品批量上传到沃尔玛,用于批量商品上传。他们建议先验证XML有效负载,然后再发送给我正在做的Walmart,并针对他们提供的XSD成功验证XML有效负载。当我调用他们的API时,得到以下响应:
<?xml version="1.0" encoding="UTF-8"?>
<ns2:PartnerFeedResponse xmlns:ns2="http://walmart.com/">
<ns2:feedId>A8AE483052804A1EA7CEF07024D861F6@AQMBAgA</ns2:feedId>
<ns2:feedStatus>ERROR</ns2:feedStatus>
<ns2:feedSubmissionDate>2019-04-17T18:31:59.995Z</ns2:feedSubmissionDate>
<ns2:ingestionErrors>
<ns2:ingestionError>
<ns2:type>DATA_ERROR</ns2:type>
<ns2:code>ERR_INT_SYS_0801003</ns2:code>
<ns2:field>IB</ns2:field>
<ns2:description>Unknown XML root MPItem</ns2:description>
</ns2:ingestionError>
</ns2:ingestionErrors>
<ns2:itemsReceived>0</ns2:itemsReceived>
<ns2:itemsSucceeded>0</ns2:itemsSucceeded>
<ns2:itemsFailed>0</ns2:itemsFailed>
<ns2:itemsProcessing>0</ns2:itemsProcessing>
<ns2:offset>0</ns2:offset>
<ns2:limit>50</ns2:limit>
<ns2:itemDetails />
</ns2:PartnerFeedResponse>
错误是未知的XML根MPItem
我的有效载荷如下:
<?xml version="1.0" encoding="UTF-8"?>
<MPItemFeed xmlns="http://walmart.com/">
<MPItemFeedHeader>
<version>3.2</version>
<requestId>Kenco3064</requestId>
<requestBatchId>Kenco3213</requestBatchId>
<feedDate>2019-04-17T23:36:28</feedDate>
<mart>WALMART_US</mart>
</MPItemFeedHeader>
<MPItem>
<processMode>CREATE</processMode>
<sku>303110</sku>
<productIdentifiers>
<productIdentifier>
<productIdType>UPC</productIdType>
<productId>400116008189</productId>
</productIdentifier>
</productIdentifiers>
<MPProduct>
<SkuUpdate>No</SkuUpdate>
<msrp>100</msrp>
<productName>Original Washed Insulated Bib</productName>
<additionalProductAttributes>
<additionalProductAttribute>
<productAttributeName>size</productAttributeName>
<productAttributeValue>XL</productAttributeValue>
</additionalProductAttribute>
</additionalProductAttributes>
<category>
<ClothingCategory>
<Clothing>
<brand>BERNE APPAREL</brand>
<manufacturer>BERNE APPAREL</manufacturer>
<shortDescription>SHORT DESCRIPTION OF CLOTHING</shortDescription>
<multipackQuantity>16</multipackQuantity>
<keyFeatures>
<keyFeaturesValue>""</keyFeaturesValue>
</keyFeatures>
<mainImageUrl>https://www.atkenco.comhttp://slsdemo.celerant.comhttps://www.atkenco.com/ProdImages/23415-DEFAULT-L.jpg</mainImageUrl>
<productSecondaryImageURL>
<productSecondaryImageURLValue>https://www.atkenco.comhttp://slsdemo.celerant.comhttps://www.atkenco.com/ProdImages/23415-DEFAULT-M.jpg</productSecondaryImageURLValue>
</productSecondaryImageURL>
<colorCategory>
<colorCategoryValue>Blue</colorCategoryValue>
</colorCategory>
<recycledMaterialContent>
<recycledMaterialContentValue>
<recycledMaterial>""</recycledMaterial>
<percentageOfRecycledMaterial>1000.00</percentageOfRecycledMaterial>
</recycledMaterialContentValue>
</recycledMaterialContent>
<countPerPack>0</countPerPack>
<count>0</count>
<pieceCount>0</pieceCount>
<material>MA</material>
<isSet>Yes</isSet>
<color>BLACK</color>
<clothingSize>XL</clothingSize>
<gender>Male</gender>
<ageGroup>
<ageGroupValue>Adult</ageGroupValue>
</ageGroup>
<clothingSizeGroup>Men</clothingSizeGroup>
<isProp65WarningRequired>No</isProp65WarningRequired>
<sleeveLengthStyle>Short Sleeve</sleeveLengthStyle>
<suitBreastingStyle>double-breasted</suitBreastingStyle>
<hatSize>8</hatSize>
<chestSize>
<measure>1000.00</measure>
<unit>cm</unit>
</chestSize>
<tightsSheerness>sheer</tightsSheerness>
<sockRise>thigh-high</sockRise>
<fabricContent>
<fabricContentValue>
<materialName>""</materialName>
<materialPercentage>1000.00</materialPercentage>
</fabricContentValue>
</fabricContent>
<fabricCareInstructions>
<fabricCareInstruction>""</fabricCareInstruction>
</fabricCareInstructions>
<clothingWeight>lightweight</clothingWeight>
<dressStyle>string</dressStyle>
<gotsCertification>No</gotsCertification>
<globalBrandLicense>
<globalBrandLicenseValue>""</globalBrandLicenseValue>
</globalBrandLicense>
<isMaternity>No</isMaternity>
<warrantyURL>http://istar2-com.securec104.ezhostingserver.com/ProductDetail.cfm?Id=336-2!10</warrantyURL>
<braBandSize>
<measure>1000.00</measure>
<unit>in</unit>
</braBandSize>
<neckSize>
<measure>1000.00</measure>
<unit>in</unit>
</neckSize>
</Clothing>
</ClothingCategory>
</category>
</MPProduct>
<MPOffer>
<price>99.95</price>
<MinimumAdvertisedPrice>99.95</MinimumAdvertisedPrice>
<StartDate>2018-03-10</StartDate>
<EndDate>2019-03-15</EndDate>
<MustShipAlone>Yes</MustShipAlone>
<ShippingWeight>
<measure>10.00</measure>
<unit>lb</unit>
</ShippingWeight>
<ProductTaxCode>100</ProductTaxCode>
<shipsInOriginalPackaging>Yes</shipsInOriginalPackaging>
<ShippingOverrides>
<ShippingOverrideAction>REPLACE_ALL</ShippingOverrideAction>
<shippingOverride>
<ShippingOverrideIsShippingAllowed>Yes</ShippingOverrideIsShippingAllowed>
<ShippingOverrideShipMethod>ONE_DAY</ShippingOverrideShipMethod>
<ShippingOverrideShipRegion>APO_FPO</ShippingOverrideShipRegion>
<ShippingOverrideshipPrice>100.00</ShippingOverrideshipPrice>
</shippingOverride>
</ShippingOverrides>
</MPOffer>
</MPItem>
</MPItemFeed>
用于验证我的XML有效负载的主要XSd MPItemFeed.xsd是:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wm="http://walmart.com/" targetNamespace="http://walmart.com/" elementFormDefault="qualified" version="3.2">
<xsd:include schemaLocation="http://localhost:8500/walmartapi/WMServices/inlcudes/schema/Items/MPItemFeedHeader.xsd" />
<xsd:include schemaLocation="http://localhost:8500/walmartapi/WMServices/inlcudes/schema/Items/MPItem.xsd" />
<xsd:element name="MPItemFeed">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="MPItemFeedHeader" type="wm:MPItemFeedHeader" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Feed header</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="MPItem" type="wm:MPItem" minOccurs="1" maxOccurs="10000" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
进一步包括MPItem.xsd
并具有MPItem
元素定义。您还可以通过搜索邮政编码来从https://developer.walmart.com/#/apicenter/marketPlace/latest#bulkCreateUpdateItems下载xsd。
似乎他们正在针对不同的XSD进行验证,然后在其开发门户上提供了这些信息?