亚马逊产品广告API C#

问题描述 投票:7回答:3

有人可以告诉我使用亚马逊产品广告API的C#示例,例如查找项目。由于变化,我发现的所有现在都不起作用。

谢谢!

编辑:

最流行的错误是“邮件正文序列化失败:ItemSearchRequest1无法创建临时类”

c# amazon amazon-product-api
3个回答
4
投票

这里有一个C#示例:

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

FWIW,the AWS thread I mentioned包含以下步骤以解决变通方法:

这些是截至2012年1月31日在Visual Studio for .Net客户端修复此问题的步骤:

1)单击解决方案资源管理器中包含亚马逊服务参考的项目的“显示所有文件”按钮。

2)展开引用并在编辑器中打开AWSECommerceService.wsdl文件

3)在第584行,将“maxOccurs”改为“1”。

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

4)保存AWSECommerceService.wsdl文件

5)右键单击Reference.svcmap并单击“运行自定义工具”

6)展开Reference.svcmap并打开Reference.cs或Reference.vb


9
投票

您可以使用以下nuget包。

PM> Install-Package Nager.AmazonProductAdvertising

搜索示例

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

var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.DE);
var result = wrapper.Search("canon eos", AmazonSearchIndex.Electronics, AmazonResponseGroup.Large);

2
投票

如果你想使用Html REST而不是Soap / Wsdl,我在我的博客上为2011 API和Visual Studio 2012更新了一个示例:"Up to date CSharp REST sample"

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