Web Service Example 3: XML Schema Definition for an AGE type with Allowed Values

Previous Next

This topic is part of Web Service Example 3: RPC-Oriented Method with a Complex Type Parameter Based on a Domain with Allowed Values. In this example, you need an XML schema definition for an AGE simple type to let the client application know that this simple type has only 4 allowed values.

The XML schema definition for this XML output is:

<?xml version="1.0"?>

<xsd:schema targetNamespace="urn:InsertTour" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:InsertTour">

   <xsd:simpleType name="Age">

       <xsd:restriction base="xsd:integer">    

           <xsd:enumeration value="18"/>

           <xsd:enumeration value="35"/>

           <xsd:enumeration value="50"/>

           <xsd:enumeration value="65"/>

       </xsd:restriction>

   </xsd:simpleType>

</xsd:schema>