The WSDL and Schema
A schema can be a standalone document (mySchema.xsd), or can be embedded in a WSDL file in a <types> element.
In this excerpt from the WeatherSummary.wsdl, the message weatherUpdate has a part, weatherData, whose type is a WeatherSummary, used in the one-way operation weatherUpdate. (The fact that the operation is one-way rather than the more common request-response is not relevant to this discussion. For more information on one-way operations, see Chapter 9.)
<message name="weatherUpdate">
<part name="weatherData" type="wsx:WeatherSummary"/>
<!-- One-way -->
<operation name="weatherUpdate">
<input message="tns:weatherUpdate"/>
The type WeatherSummary is complex and must therefore be defined elsewhere in the WSDL in a types element, or in a referenced schema. The WeatherSummary.wsdl file embeds the schema rather than referencing an external file, like so:
<xsd:complexType name="WeatherSummary">
<xsd:element name="zipcode" type="xsd:string"/>
<xsd:element name="windSpeed" type="xsd:unsignedInt"/>
<xsd:element name="sky" type="xsd:string"/>
<xsd:element name="temp" type="xsd:int"/>
Note that the WeatherSummary complex type contains four simple types, zipcode, windSpeed, sky, and temp.