Until this week we have been using some of the DLL’s provided by Amazon for .Net. Tuesday one of the DLL’s became deprecated. So I downloaded the C# code that Amazon is providing in hops that we can just implement that direct. For order downloads we have working code.
For order fulfillment and product inventory updating we’re running into the “The request signature we calculated does not match the signature you provided” error. The code is actually pretty simple and almost a drop in replacement for their older DLL.
I have stepped through the Amazon code and I’m getting the proper values for AccessKeyId, SecretAccessKey, and MerchantId at all of the levels.
I have no read many article of people having similar problems and finding a solution but never posting the solutions.
Any support would be greatly appreciated.
Assuming that I’m using the correct AccessKeyId, SecretAccessKey, MerchantId, and AuthToken (which was never required in the original), this should work.
The only thing that I have added (which is from testing) is the SignatureMethod and SignatureVersion (which in the old code was default). I have tried it with or without that same code.
AmazonApi.MarketplaceWebService.MarketplaceWebServiceConfig mwsConfig = new AmazonApi.MarketplaceWebService.MarketplaceWebServiceConfig();
mwsConfig.ServiceURL = "https://mws.amazonservices.com/Feeds/2009-01-01";
mwsConfig.SignatureMethod = _signatureMethod; //"HmacSHA256"
mwsConfig.SignatureVersion = _signatureVersion; // "2"
AmazonApi.MarketplaceWebService.MarketplaceWebServiceClient mwsClient = new AmazonApi.MarketplaceWebService.MarketplaceWebServiceClient(_awsAccessKeyId, _awsSecretAccessKey, mwsConfig);
// The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
AmazonApi.MarketplaceWebService.Model.SubmitFeedRequest request = new AmazonApi.MarketplaceWebService.Model.SubmitFeedRequest();
//request.MWSAuthToken = _mwsAuthToken;
request.Merchant = _merchantId;
request.MarketplaceIdList = new AmazonApi.MarketplaceWebService.Model.IdList();
request.FeedContent = new MemoryStream(Encoding.UTF8.GetBytes(content));
request.ContentMD5 = AmazonApi.MarketplaceWebService.MarketplaceWebServiceClient.CalculateContentMD5(request.FeedContent);
request.FeedContent.Position = 0;
request.FeedType = feedType;
AmazonApi.MarketplaceWebService.Model.SubmitFeedResponse response = mwsClient.SubmitFeed(request);