Binding
Binding values include HTTP GET, HTTP POST, and SOAP. SOAP is not tied to a specific transport. SMTP, FTP, HTTP are just some of the options that can transport a SOAP request. HTTP, however, is most commonly used. While both HTTP GET and HTTP POST are allowed, HTTP POST is preferred because many servers place character limits on HTTP GET requests.
Product Advertising API uses SOAP, as shown in the following Product Advertising API WSDL snippet.
<binding name="AWSECommerceServiceBinding" type="tns:AWSECommerceServicePortType"> ... <operation name="ItemSearch"> <soap:operation soapAction="http://soap.amazon.com" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> </operation>
This binding shows that Product Advertising API uses two SOAP extensions: soap:operation and soap:body.
The soap:operation element specifies that the Product Advertising API
operation, ItemSearch
, in this case, is bound to a
specific SOAP implementation. The soapAction attribute specifies that the
SOAPAction HTTP header is used to identify the Product Advertising API
service, which is the URI value of soapAction, http://soap.amazon.com.. soapAction
enables Amazon web servers to determine the intent of the SOAP request without
having to examine the message portion of the SOAP payload. Specifying this URI
is required to access Product Advertising API web servers.
The soap:body element specifies the input and output details. The value in the Product Advertising API WSDL is "literal," which means that instead of encoding the input and output as a SOAP struct, a literal XML document is used. You have seen that Product Advertising API responses are XML documents.