Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon (AWS) - The request must contain the parameter Signature

I'm struggling with the final part of getting my first bit of code working with the AWS - I have got this far, I attached the web reference in VS and this have this

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>");
}

I get the error

The request must contain the parameter Signature.

I know you have to 'sign' requests now, but can't figure out 'where' I would do this or how? any help greatly appreciated?

like image 998
YodasMyDad Avatar asked May 29 '10 13:05

YodasMyDad


1 Answers

You have to add to the SOAP request headers including your Amazon access key ID, a timestamp, and the SHA256 hash of the request operation and the timestamp. To accomplish that, you would need access to the SOAP message just before it is going to be sent out. There's a walkthrough and a sample project I put together at http://flyingpies.wordpress.com/2009/08/01/17/.

like image 108
Oren Trutner Avatar answered Sep 27 '22 17:09

Oren Trutner