Java Reference
In-Depth Information
</xs:sequence>
<xs:attribute type="xs:string" name="city"
use="optional" />
<xs:attribute type="xs:date" name="date"
use="optional" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Optimizing the Generated XSD File
As you can see, the generated XSD file allows clients to query temperatures of unlimited dates. If you
want to add a constraint on the maximum and minimum query dates, you can modify the maxOccurs and
minOccurs attributes.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace=" http://springenterpriserecipes.apress.com/weather/schemas"
xmlns:xs=" http://www.w3.org/2001/XMLSchema">
<xs:element name="GetTemperaturesRequest">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="city" />
<xs:element type="xs:date" name="date"
maxOccurs="5" minOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetTemperaturesResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="TemperatureInfo"
maxOccurs="5" minOccurs="1">
...
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Previewing the Generated WSDL File
As you will learn later, Spring-WS can automatically generate the service contract for you, based on the
data contract and some conventions that you can override. Here, you can preview the generated WSDL
file to better understand the service contract. For simplicity's sake, the less-important parts are omitted.
Search WWH ::




Custom Search