Exeu/Amazon-ECS-PHP-Library

Amazon now requires requests signed with associate tags, etc.

Closed this issue · 2 comments

This library no longer works, as Amazon now requires requests signed with associate tags. Also, I think the old WSDL URL was deprecated.

Here are the required changes to the Amazon-ECS-PHP-Library to make it work again! :-)

I apologize for not knowing enough about git to submit the fixes properly...

First, go to the line where you invoke the request. Here is what I used to have:

$amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, '');

Change that to this:

$amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, '', AWS_ASSOCIATE_TAG);

Now, make sure that AWS_ASSOCIATE_TAG is set in your sampleSettings.php file (or wherever your settings are set).

I also went to lib/AmazonECS.class.php and changed this line:

protected $webserviceUri = 'http://ecs.amazonaws.com/AWSECommerceService/2010-11-01/%%COUNTRY%%/AWSECommerceService.wsdl';

to this:

protected $webserviceUri = 'http://ecs.amazonaws.com/AWSECommerceService/%%COUNTRY%%/AWSECommerceService.wsdl';

This fixed it!

"protected $webserviceUri = 'http://ecs.amazonaws.com/AWSECommerceService/%%COUNTRY%%/AWSECommerceService.wsdl';"

The problem with this is it appears to be the top-level schema. So if they change spec and provide inadequate communication or deprecate the old endpoint in error again, the class will fail.

A more flexible fix might be to replace the endpoint with this. Hopefully this will remain a valid endpoint even if they upgrade it to a new version.

protected $webserviceUri = 'http://ecs.amazonaws.com/AWSECommerceService/2011-08-01/%%COUNTRY%%/AWSECommerceService.wsdl';

Exeu commented

Thanks for your efforts!
I noticed that the Old Endpoints are now available again. So the class works for me without any changes.
I will have a closer look to the New endpoint and its resulting changes to the class soon to prepare this class for the future.