通过UPC查找商品的Amazon Web服务 [英] Amazon web service with item lookup by UPC

查看:185
本文介绍了通过UPC查找商品的Amazon Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作环境是Visual Studio 2008 + C#

My Working Envirnment is Visual Studio 2008 + C#

我正在使用Amazon WebService,我想使用SOAP从亚马逊获取数据,但是当我尝试通过IDType = UPC,它会给我以下错误消息,那么我该怎么办?

I am working on Amazon WebService, I want to fetch the data from Amazon using SOAP but when I am trying to pass IDType = UPC it gives me below error message, so what can I do for this ?

错误:


036725229884不是ItemId的有效值。请更改此值,然后重试您的请求

036725229884 is not a valid value for ItemId. Please change this value and retry your request

MyCode:

ItemLookupRequest request1 = new ItemLookupRequest();
request1.IdType = ItemLookupRequestIdType.UPC;
request1.IdTypeSpecified = true;
request1.ItemId = new string[] { ProductID };
request1.ResponseGroup = new string[] { "Request", "Large", "OfferFull", "BrowseNodes" };
request1.MerchantId = "All";
request1.Condition = Condition.All;
request1.SearchIndex = "Books";

注意:
如何添加多个( 图书,照片,视频)?

Note: How can I add multiple SearchIndex like ("Books","Photo","Video")?

我使用了以下WebService:
http://webservices.amazon.com/AWSECommerceService/2009-11-01/US/AWSECommerceService.wsdl

I have used following WebService: http://webservices.amazon.com/AWSECommerceService/2009-11-01/US/AWSECommerceService.wsdl

推荐答案

还要对UPC和EAN之间的差异感到厌倦。

Also be weary of the difference between UPC and EAN.

UPC = 12位,
EAN = 13位

UPC = 12 digits, EAN = 13 digits

UPC 738678251584 (12位数字)或EAN 3253581057803 (13位数字)到Amazon.com时,两者都将显示为说明中的UPC,但使用API​​时,您必须在搜索时指定EAN。

If you just punch in a UPC 738678251584 (12 digits) or EAN 3253581057803 (13 digits) to Amazon.com it will show both as being UPC in the description, but using the API you must specify EAN when searching.

我们同时提供两种产品,您需要相应地指定搜索类型,否则将无法指定

We have products with both and you need to specify the search type accordingly or it won't get found.

编辑:或者您可以在任何12位数字前添加0,然后始终搜索EAN。这可能是最好的解决方案。根据定义 0 + UPC = EAN

Edit: OR you can just prepend a 0 to any 12 digit numbers and always search for EAN. This is probably the best solution. By definition "0" + UPC = EAN

此请求对我有用(searchType是UPC或EAN):

This request worked for me (searchType is either UPC or EAN):

        ItemLookup itemLookup = new ItemLookup()
        {
            AssociateTag = "XXXXX-20",
        };
        itemLookup.AWSAccessKeyId = ACCESS_ID;

        ItemLookupRequest itemLookupRequest = new ItemLookupRequest();
        itemLookupRequest.IdTypeSpecified = true;
        itemLookupRequest.IdType = searchType;
        itemLookupRequest.SearchIndex = "All";
        itemLookupRequest.ItemId = upcEanList;
        itemLookupRequest.ResponseGroup = new[] { "OfferSummary", "ItemAttributes" };
        itemLookup.Request = new ItemLookupRequest[] { itemLookupRequest };

这篇关于通过UPC查找商品的Amazon Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆