简体   繁体   中英

Amazon Product Advertising API C#

Can somebody tell me C# excample of using Amazon Product Advertising API, for example to lookup item. All i found is not working now because of changes.

Thanks!

edit:

the most popular error is "Failed serialization of message body: ItemSearchRequest1 cant create temporary class"

You can use the following nuget package.

PM> Install-Package Nager.AmazonProductAdvertising

Search example

var authentication = new AmazonAuthentication();
authentication.AccessKey = "accesskey";
authentication.SecretKey = "secretkey";

var client = new AmazonProductAdvertisingClient(authentication, AmazonEndpoint.DE);
var result = await client.SearchItemsAsync("canon eos");

There's a C# sample here:

http://aws.amazon.com/code/Product-Advertising-API/3941

FWIW, the AWS thread I mentioned includes these steps for a workaround:

These are the steps as of January 31, 2012 to fix this issue in Visual Studio for .Net clients:

1) Click the "Show all files" button in the Solution Explorer for the project containing the amazon service reference.

2) Expand the reference and open the AWSECommerceService.wsdl file in the editor

3) On line 584 change the "maxOccurs' to "1".

<xs:element minOccurs="0" maxOccurs="1" name="ImageSets">

4) Save the AWSECommerceService.wsdl file

5) Right click Reference.svcmap and click "Run custom tool"

6) Expand Reference.svcmap and open either Reference.cs or Reference.vb

如果您想使用 Html REST 而不是 Soap/Wsdl,我在我的博客上为 2011 API 和 Visual Studio 2012 更新了一个示例: “最新的 CSharp REST 示例”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM