我正在尝试使用以下代码在亚马逊网络服务示例代码页面中搜索亚马逊产品数据库

AWSECommerceService ecs = new AWSECommerceService();

// Create ItemSearch wrapper
ItemSearch search = new ItemSearch();
search.AssociateTag = "ABC";
search.AWSAccessKeyId = "XYZ";

// Create a request object
ItemSearchRequest request = new ItemSearchRequest();

// Fill request object with request parameters
request.ResponseGroup = new string[] { "ItemAttributes" };

// Set SearchIndex and Keywords
request.SearchIndex = "All";
request.Keywords = "The Shawshank Redemption";

// Set the request on the search wrapper
search.Request = new ItemSearchRequest[] { request };

try
{
    //Send the request and store the response
    //in response

    ItemSearchResponse response = ecs.ItemSearch(search);
    gvRes.DataSource = response.Items;
}
catch (Exception ex)
{
    divContent.InnerText = ex.Message;
}

并收到以下错误



亚马逊文档不清楚如何签署请求。

知道如何使它工作吗???

谢谢

最佳答案

有一个名为 SignedRequestHelper 的 REST 助手类。

你这样称呼它:

SignedRequestHelper helper =
        new SignedRequestHelper(MY_AWS_ACCESS_KEY_ID, MY_AWS_SECRET_KEY, DESTINATION);
requestUrl = helper.Sign(querystring);

上面链接中的 SOAP 调用必须有一个类似的。

关于c# - 亚马逊产品广告 API 签名问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5793072/

10-11 06:56