Web Service Example 6: XML Schema Definition for Scheduled Tours

Previous Next

This topic is part of Web Service Example 6: RPC-Oriented Method with Complex Type Soap Array Parameters. In this example, you need an XML schema definition for Scheduled Tours. First, here is an example of the Scheduled Tours XML output for which we need an XML schema:

<Scheduled_Tours documentName="Scheduled_Tours">

<SCHEDTOUR>

<SCHEDTOUR_ID>50</SCHEDTOUR_ID>

<DESTINATION>AUSTRALIA</DESTINATION>

<TOUR_TYPE>ISLAND SUNTANNER</TOUR_TYPE>

<START_DATE>2005-11-01000000</START_DATE>

<RETURN_DATE>2005-11-13000000</RETURN_DATE>

<PRICE>120</PRICE>

<MAX_PART>10</MAX_PART>

<GUIDE>137</GUIDE>

</SCHEDTOUR>

<SCHEDTOUR>

<SCHEDTOUR_ID>51</SCHEDTOUR_ID>

<DESTINATION>AUSTRALIA</DESTINATION>

<TOUR_TYPE>ISLAND SUNTANNER</TOUR_TYPE>

<START_DATE>2005-11-15000000</START_DATE>

<RETURN_DATE>2005-11-27000000</RETURN_DATE>

<PRICE>122</PRICE>

<MAX_PART>5</MAX_PART>

<GUIDE>6</GUIDE>

</SCHEDTOUR>

</Scheduled_Tours>

The XML schema definition for this XML output is:

<?xml version="1.0"?>

<xsd:schema targetNamespace="urn:Array" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

 

<xsd:complexType name="ArrayOfScheduledTours">

   <xsd:complexContent>

   <xsd:restriction base="soapenc:Array">

   <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="tns:ScheduledTour[]"/>

   </xsd:restriction>

   </xsd:complexContent>

</xsd:complexType>

 

<xsd:complexType name="ScheduledTour">

   <xsd:sequence>

       <xsd:element name="TOUR_TYPE" type="xsd:string"/>

       <xsd:element name="START_DATE" type="xsd:string"/>

       <xsd:element name="RETURN_DATE" type="xsd:string"/>

       <xsd:element name="PRICE" type="xsd:integer"/>

       <xsd:element name="MAX_PART" type="xsd:integer"/>

       <xsd:element name="GUIDE" type="xsd:integer"/>

   </xsd:sequence>

</xsd:complexType>

 

</xsd:schema>