Amazon Associates Web Service supports the SOAP message protocol for calling Amazon Associates Web Service operations over an HTTP connection. The easiest way to use the SOAP interface with your application is to use a SOAP toolkit appropriate for your platform. SOAP toolkits are available for most popular programming languages and platforms.
The service's Web Services Definition Language (WSDL) file describes the operations and the format and data types of their requests and responses. Your SOAP toolkit interprets the WSDL file to provide your application access to the operations. For most toolkits, your application calls a service operation using routines and classes provided or generated by the toolkit.
For more information, see WSDL Locations.
A SOAP request is an XML data structure generated by a SOAP toolkit that is sent to a web service. The root element of this structure is named after the operation and contains the values for the operation's parameters.
The root element of every request must contain:
A value for AWSAccessKeyId to authenticate the request.
For more information, see AWS Access Key ID.
An endpoint, which is the destination for the request.
For more information, see Request Terms That Remain the Same.
A request element, which contains the values for the operation's parameters.
The API Reference describes all of the Amazon Associates Web Service operations and their parameters. The Amazon Associates Web Service WSDL shows how the operation parameters appear in the XML request generated by your toolkit.
SOAP requests use endpoints in their requests. The endpoint value varies by locale but there are only two endpoints per locale. One endpoint in a locale is the secure version of the other endpoint. The following table lists the endpoints to use in Amazon Associates Web Service SOAP requests.
| Locale | Endpoint |
|---|---|
| CA |
http://ecs.amazonaws.ca/onca/soap https://aws.amazonaws.ca/onca/soap |
| DE |
http://ecs.amazonaws.de/onca/soap https://aws.amazonaws.de/onca/soap |
| FR |
http://ecs.amazonaws.fr/onca/soap https://aws.amazonaws.fr/onca/soap |
| JP |
http://ecs.amazonaws.jp/onca/soap https://aws.amazonaws.jp/onca/soap |
| UK |
http://ecs.amazonaws.co.uk/onca/soap https://aws.amazonaws.co.uk/onca/soap |
| US |
http://ecs.amazonaws.com/onca/soap https://aws.amazonaws.com/onca/soap |
The following example is the XML for a SOAP message that calls the ItemSearch operation. While you will probably not be building
the SOAP message for a service request manually, it is useful to see what your
SOAP toolkit produces when provided with the appropriate values. Many SOAP
toolkits require that you build a request data structure similar to the XML to
make a request.
The
element contains the parameters common to all requests. The
ItemSearch
Request element contains the ItemSearch parameters, SearchIndex and Keywords.
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ItemSearch xmlns="http://ecs.amazonaws.com/AWSECSCommerce/onca/soap">
<AWSAccessKeyId>0PAP1H1P8JJVZEXAMPLE</AWSAccessKeyId>
<Request>
<SearchIndex>Books</SearchIndex>
<Keywords>Harry%20Potter</Keywords>
</Request>
</ItemSearch>
</soapenv:Body>
</soapenv:Envelope>