Product Advertising API
Developer Guide (API Version 2011-08-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Anatomy of a WSDL

Typically, the Binding and Service segments do not change from one WSDL release to the next. In the Definitions segment, only the WSDL version changes. For that reason, when you read a WSDL, you will typically spend most of your time reading the Request and Response Definitions segments.

Definitions

The Definitions section of the WSDL defines the namespaces used throughout the WSDL, and the name of the service, as shown in the following snippet of the Product Advertising API WSDL.

<?xml version="1.0" encoding="UTF-8" ?>
<definitions
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:tns="http://webservices.amazon.com/
  AWSECommerceService/2011-08-01"
  targetNamespace="http://webservices.amazon.com/
  AWSECommerceService/2011-08-01">

This example shows that the:

  • Default namespace is xmlns="http://schemas.xmlsoap.org/wsdl/"

  • SOAP namespace used is xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

  • Schema used is xmlns:xs="http://www.w3.org/2001/XMLSchema"

  • Product Advertising API WSDL namespace is "http://webservices.amazon.com/AWSECommerceService/2011-08-01"

    The date at the end is the version number. It is the date the WSDL became public.

  • TargetNamespace is "http://webservices.amazon.com/AWSECommerceService/2011-08-01"

    The TargetNamespace is an XML schema convention that enables the WSDL to refer to itself (as the target). The TargetNamespace value is the Product Advertising API WSDL namespace

Namespaces

Namespaces are collections of parameters and operations in which their names are unique. The advantage of using namespaces is that the WSDL can define terms, like string, just by referring it its namespace, xs. Also, prepending the namespace to a parameter ensures that there is no danger of name collisions.

Each namespace declaration starts with "xmlns:" (XML namespace:) and is followed by the abbreviation for the namespace. For example, in the following namespace declaration, xs becomes the abbreviation for the URL of the schema.

xmlns:xs="http://www.w3.org/2001/XMLSchema"

Throughout the remainder of the WSDL you will see parameters defined in terms of namespace abbreviations, for example:

type="xs:string"
ref="tns:HTTPHeaders"

These abbreviations provide the namespace in which the parameters are defined.

Versioning

Product Advertising API enables you to specify the version of the WSDL you want to use. This functionality ensures that future enhancements and changes to Product Advertising API WSDLs will not be intrusive to your applications. For example, when Product Advertising API adds new elements to its WSDL, applications that validate against an older Product Advertising API WSDLs will not be affected.

Product Advertising API WSDL version names are based on the date that they become active. The version of the WSDL is specified in the Product Advertising API WSDL namespace declaration. In the preceding example, the version of the WSDL is 2011-08-01.

xmlns:tns="http://webservices.amazon.com/
  AWSECommerceService/2011-08-01"

In reality, the date, here, is the WSDL's file name.

The AWSECommerceService directory contains all of the Product Advertising API WSDL versions. You use the Version parameter in REST requests to specify the version of the WSDL you want to use. The default version is 2005-10-05. If you want to use a different WSDL version, including the latest, you must specify it in each request, for example, in REST.

http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService
&AWSAccessKeyId=[AWS Access Key ID]
&Operation=ItemSearch&
SearchIndex=Books&
Author=Steve%20Davenport&
Version=2011-08-01
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request Signature]
[Note]Note

This version of the Product Advertising API Developer Guide describes all of the functionality of the WSDL as of the guide's publication date. To read about older WSDLs, including the default WSDL, refer to the older versions of this guide listed in the AWS Resource Center. Go to http://aws.amazon.com/resources.

SOAP requests always specify a namespace, which includes the WSDL version. To avoid problems due to future WSDL changes, be sure to specify a WSDL version in your SOAP application.