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
Topics
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://ecs.amazonaws.com/ AWSECommerceService/2006-09-13" targetNamespace="http://ecs.amazonaws.com/ AWSECommerceService/2006-09-13">
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://ecs.amazonaws.com/AWSECommerceService/2006-09-13"
The date at the end is the version number. It is the date the WSDL became public.
-
TargetNamespace is "http://ecs.amazonaws.com/AWSECommerceService/2006-09-13"
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
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 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 2006-09-13.
xmlns:tns="http://ecs.amazonaws.com/ AWSECommerceService/2006-09-13"
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://ecs.amazonaws.com/onca/xml? Service=AWSECommerceService &AWSAccessKeyId=[AWS Access Key ID]
&Operation=ItemSearch
& SearchIndex=Books& Author=Steve%20Davenport& Version=2006-09-13
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.