title: SignatureDoesNotMatch in Amazon API
body: <p>I am using the Amazon API and get this error while updating my stock from my database to Amazon website:</p>
  
  <pre><code>Caught Exception: Internal Error
  Response Status Code: 0
  Error Code:
  Error Type:
  Request ID:
  XML:
  </code></pre>
  
  <p>I read this thread (amazonsellercommunity . com/forums/thread.jspa?messageID=2194823) and then get the error explanation:</p>
  
  <pre><code>&lt;Error&gt;&lt;Type&gt;Sender&lt;/Type&gt;&lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;&lt;Message&gt;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.&lt;/Message&gt;&lt;Detail/&gt;&lt;/Error&gt;
  </code></pre>
  
  <p>So I thought my MARKETPLACE_ID, MERCHANT_ID, AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY could be wrong. But I checked and these informations are correct.</p>
  
  <p>Actually, I don't understand why this error happens... Before, it worked perfectly and since a couple of days it just crash. And I don't change anything in my code. Strange, isn't it?</p>
  
  <p>Edit :</p>
  
  <p>Here is my section code for signature.</p>
  
  <pre><code>define ('DATE_FORMAT', 'Y-m-d\TH:i:s\Z');
  define('AWS_ACCESS_KEY_ID', 'ABC...'); // My AWS Access Key Id (20 characters)
  define('AWS_SECRET_ACCESS_KEY', 'ABCDEF...'); // My AWS Secret Access Key (40 characters)
  define('APPLICATION_NAME', 'MyCompany_AmazonMWS');
  define('APPLICATION_VERSION', '0.0.1');
  define ('MERCHANT_ID', 'XXXXXXX'); // My Merchant ID
  define ('MARKETPLACE_ID', 'XXXXXXX'); // My Marketplace ID
  
  $config = array (
  'ServiceURL' =&gt; "https://mws.amazonservices.fr",
  'ProxyHost' =&gt; null,
  'ProxyPort' =&gt; -1,
  'MaxErrorRetry' =&gt; 3,
  );
  
  $service = new MarketplaceWebService_Client(
  AWS_ACCESS_KEY_ID,
  AWS_SECRET_ACCESS_KEY,
  $config,
  APPLICATION_NAME,
  APPLICATION_VERSION
  );
  
  $parameters = array (
  'Marketplace' =&gt; MARKETPLACE_ID,
  'Merchant' =&gt; MERCHANT_ID,
  'FeedType' =&gt; '_POST_INVENTORY_AVAILABILITY_DATA_',
  'FeedContent' =&gt; $feedHandle,
  'PurgeAndReplace' =&gt; false,
  'ContentMd5' =&gt; base64_encode(md5(stream_get_contents($feedHandle), true)),
  );
  
  // and then I do this:
  
  $request = new MarketplaceWebService_Model_SubmitFeedRequest($parameters);
  invokeSubmitFeed($service, $request);
  </code></pre>
  
  <p>If you want to see some parts of my code, just ask.</p>
  
  <p>Thank you in advance.</p>