Request Definitions
The Request Definitions segment of the WSDL defines Product Advertising API operation requests, as shown in the following WSDL snippet.
<xs:complexType name="ItemSearch
Request">
<xs:sequence>
<xs:element name="Actor" type="xs:string" minOccurs="0" />
<xs:element name="Artist" type="xs:string" minOccurs="0" />
<xs:element name="Availability" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Available" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element ref="tns:AudienceRating" minOccurs="0" maxOccurs="unbounded" />
This snippet shows some of ItemSearch
's input
parameters, including Actor
, Artist
, Availability
, and AudienceRating
. The element declarations specify that these
parameters are valid in an ItemSearch
request. Most of the
parameters in this example are strings. The type of one, however, Availability
, is a variation on the base class, string. In this
case, the variation puts a restriction on the strings that can be valid values
for Availability
. For that reason, the restriction
keyword is used. The restriction is that the valid values for Availability
are defined by an enumeration. The enumeration,
however, has only one valid value, "Available," which means that the
parameter, Availability
can be set to only one value.
minOccurs
refers to the minimum number of times the
parameter must appear in an ItemSearch
request. If the
value is zero, the associated parameter is optional. If the value is 1, the
associated parameter is required to be included once in every request involving
that operation. The default value is 1, that is, if minOccurs
is not included in an element declaration, minOccurs
is 1.
maxOccurs
defines the maximum number of times the
parameter can appear in a request. The default is 1, that is, if maxOccurs
is not included in an element declaration, maxOccurs
is 1 and the parameter can only appear once in a
request. In the preceding example, maxOccurs
is
"unbounded," which means that the AudienceRating
parameter can appear any number of times in an
ItemSearch
request.
In the preceding example, the parameter types are declared to be simpleTypes. A simple type cannot have child elements or attributes. Complex types can. In practice, any parameter that can take multiple values, such as an array, must be defined as a complex type.
The following snippet shows an example of a complex type.
<xs:element name="ItemSearch"> <xs:complexType> <xs:sequence> <xs:element name="MarketplaceDomain" type="xs:string" minOccurs="0" /> <xs:element name="AWSAccessKeyId" type="xs:string" minOccurs="0" /> <xs:element name="SubscriptionId" type="xs:string" minOccurs="0" />
This definition snippet shows three of the parameters that can be part of an
ItemSearch
request.