You can interact with the web service using SOAP 1.1 over HTTP. The WSDL file, which describes the API in a machine-readable way, is available at: http://wsearch.amazonaws.com/doc/2007-03-15/AlexaWebSearch.wsdl . The Alexa Web Search response schema is available at: http://wsearch.amazonaws.com/doc/2007-03-15/AlexaWebSearch.xsd.
Most SOAP users will interact with Alexa Web Search using a SOAP toolkit tailored for their language and development environment. Different toolkits will expose the API in different ways. Please refer to your specific toolkit documentation to understand how to use it. This section illustrates SOAP operations in a toolkit-independent way by exhibiting the XML requests and responses as they appear "on the wire."
Every request must contain authentication information to establish the identity of the principal making the request. In SOAP, the authentication information is put into the following elements of the SOAP request:
Every request must contain authentication information to establish the identify of the principal making the request. In SOAP, the authentication information is put into elements in the <Request> element. The parameters needed for authentication are in the following table.
| Parameter | Description |
|---|---|
AWSAccessKeyId | Your AWS Access Key Id |
Timestamp | The current time in UTC format. Authorization will fail if this Timestamp is more than 15 minutes away from the clock on the Amazon servers. The Timestamp must be URL encoded. |
Signature | A request signature calculated by concatenating the Action name and Timestamp and then calculating an RFC 2104-compliant HMAC-SHA1 hash of that string using the Secret Access Key. Please see the code samples in the language of your choice for examples of how to generate the signature. The signature generation code is identical for both SOAP and Query requests. |
Your SOAP toolkit is responsible for formatting and sending requests based on the provided WSDL. This section shows what SOAP requests look like "on the wire".
Sample Request.
This is a sample SOAP request. Notice that the
parameters Signature,
Timestamp, and
AWSAccessKeyId are identical to those in Query
requests. The Action parameter, however, is
specified in the element name in the form of
<.
[Action]>
Example
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<ns1:Search xmlns:ns1="http://wsearch.amazonaws.com/doc/2007-03-15/">
<ns1:AWSAccessKeyId>1234567890ABCDEFGHIJ</ns1:AWSAccessKeyId>
<ns1:Signature>wRKXInvOPFpHNDLlEB92fW6oqXU=</ns1:Signature>
<ns1:Timestamp>2006-09-06T21:10:47.000Z</ns1:Timestamp>
<ns1:ResponseGroup>Results</ns1:ResponseGroup>
<ns1:Query>java</ns1:Query>
<ns1:Version>2007-03-15</ns1:Version>
</ns1:Search>
</soapenv:Body>
</soapenv:Envelope>
The SOAP response from the Web Search web service has a format specified by the schema file embedded in the WSDL file. As in SOAP requests, your SOAP toolkit should be able to consume the response data and present it programmatically to you.
Sample Response. This is a sample SOAP response.
Example
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<ns1:SearchResponse xmlns:ns1="http://wsearch.amazonaws.com/doc/2007-03-15/">
<ns1:SearchResult>
<ns1:SearchTerms>java</ns1:SearchTerms>
<ns1:EstimatedNumberOfDocuments>87568000</ns1:EstimatedNumberOfDocuments>
<ns1:Documents>
<ns1:Document>
<ns1:Url>http://java.com/en/download/index.jsp</ns1:Url>
<ns1:Title>Download Free Java Software</ns1:Title>
<ns1:Bytes>11360</ns1:Bytes>
<ns1:Checksum>AAAAAAABAkY=</ns1:Checksum>
</ns1:Document>
</ns1:Documents>
</ns1:SearchResult>
<ns1:ResponseMetaData>
<ns1:RequestId>09b4accb-ff51-4145-9988-25d38dfcb705</ns1:RequestId>
</ns1:ResponseMetaData>
</ns1:SearchResponse>
</soapenv:Body>
</soapenv:Envelope>