我正在为使我的第一部分代码与AWS结合使用而做最后的工作-我已经走了很远,我在VS中附加了Web引用,并且有了这个

amazon.AWSECommerceService service = new amazon.AWSECommerceService();

// prepare an ItemSearch request
amazon.ItemSearchRequest request = new amazon.ItemSearchRequest();
request.SearchIndex = "DVD";
request.Title = "scream";
request.ResponseGroup = new string[] { "Small" };

amazon.ItemSearch itemSearch = new amazon.ItemSearch();
itemSearch.AssociateTag = "";
itemSearch.Request = new ItemSearchRequest[] { request };
itemSearch.AWSAccessKeyId = ConfigurationManager.AppSettings["AwsAccessKeyId"];

itemSearch.Request = new ItemSearchRequest[] { request };
ItemSearchResponse response = service.ItemSearch(itemSearch);

// write out the results
foreach (var item in response.Items[0].Item)
{
    Response.Write(item.ItemAttributes.Title + "<br>");
}

我得到错误
The request must contain the parameter Signature.

我知道您现在必须“签署”请求,但无法弄清楚我将在哪里“做”或如何做?任何帮助,不胜感激?

最佳答案

您必须添加到SOAP请求 header 中,包括您的Amazon访问密钥ID,时间戳以及请求操作和时间戳的SHA256哈希。为此,您将需要在即将发送SOAP消息之前对其进行访问。我在http://flyingpies.wordpress.com/2009/08/01/17/上有一个演练和一个示例项目。

07-28 06:08