So I have been trying to get these API samples to work for three frustrating days. So far I still have had no success. I have tried about 10 different samples and of course none of them work. With some more digging the most up to date API I found was from april 2013 end even recent comments said that it worked. I knew it was just too good to be true and of course I didn't get it to work. I am pretty sure that i am missing something in that program.
here is the code:
namespace Amazon.PAAPI
{
class Program
{
static void Main(string[] args)
{
// Instantiate Amazon ProductAdvertisingAPI client
AWSECommerceServicePortTypeClient amazonClient = new AWSECommerceServicePortTypeClient();
// prepare an ItemSearch request
ItemSearchRequest request = new ItemSearchRequest();
request.SearchIndex = "Books";
request.Title = "WCF";
request.ResponseGroup = new string[] { "Small" };
ItemSearch itemSearch = new ItemSearch();
itemSearch.Request = new ItemSearchRequest[] { request };
itemSearch.AWSAccessKeyId = ConfigurationManager.AppSettings["accessKeyId"];
itemSearch.AssociateTag = "ReplaceWithYourValue";
// send the ItemSearch request
ItemSearchResponse response = amazonClient.ItemSearch(itemSearch);
// write out the results from the ItemSearch request
foreach (var item in response.Items[0].Item)
{
Console.WriteLine(item.ItemAttributes.Title);
}
Console.WriteLine("done...enter any key to continue>");
Console.ReadLine();
}
}
}
I get an error: The HTTP request was forbidden with client authentication scheme 'Anonymous'.
I did insert the AssociateTag
value and the access key id but still it gives the same results.
here is the link i downloaded it from: http://dl.dropbox.com/u/119018/amazonProductAdvertisingAPI-SOAP-WCF-Updated.zip