<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:schema="http://www.springframework.org/spring-ws/samples/airline/schemas"
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:tns="http://www.springframework.org/spring-ws/samples/airline/definitions"
                  targetNamespace="http://www.springframework.org/spring-ws/samples/airline/definitions">
    <wsdl:types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema"
                xmlns:tns="http://www.springframework.org/spring-ws/samples/airline/schemas"
                elementFormDefault="qualified"
                targetNamespace="http://www.springframework.org/spring-ws/samples/airline/schemas">

            <element name="GetFlightsRequest">
                <complexType>
                    <all>
                        <element name="from" type="tns:AirportCode"/>
                        <element name="to" type="tns:AirportCode"/>
                        <element name="departureDate" type="date"/>
                        <element minOccurs="0" name="serviceClass" type="tns:ServiceClass"/>
                    </all>
                </complexType>
            </element>

            <element name="GetFlightsResponse">
                <complexType>
                    <sequence>
                        <element maxOccurs="unbounded" minOccurs="0" name="flight" type="tns:Flight"/>
                    </sequence>
                </complexType>
            </element>

            <element name="GetFlightsFault">
                <complexType>
                    <sequence>
                        <element name="errorCode" type="string"/>
                    </sequence>
                </complexType>
            </element>

            <element name="BookFlightRequest">
                <complexType>
                    <all>
                        <element name="flightNumber" type="tns:FlightNumber"/>
                        <element name="departureTime" type="dateTime"/>
                        <element name="passengers">
                            <complexType>
                                <choice maxOccurs="9">
                                    <element name="passenger" type="tns:Name"/>
                                    <element name="username" type="tns:FrequentFlyerUsername"/>
                                </choice>
                            </complexType>
                        </element>
                    </all>
                </complexType>
            </element>

            <element name="BookFlightResponse" type="tns:Ticket"/>

            <element name="GetFrequentFlyerMileageRequest"/>

            <element name="GetFrequentFlyerMileageResponse" type="int"/>


            <complexType name="Flight">
                <sequence>
                    <element name="number" type="tns:FlightNumber"/>
                    <element name="departureTime" type="dateTime"/>
                    <element name="from" type="tns:Airport"/>
                    <element name="arrivalTime" type="dateTime"/>
                    <element name="to" type="tns:Airport"/>
                    <element name="serviceClass" type="tns:ServiceClass"/>
                </sequence>
            </complexType>

            <simpleType name="FlightNumber">
                <restriction base="string">
                    <pattern value="[A-Z][A-Z][0-9][0-9][0-9][0-9]"/>
                </restriction>
            </simpleType>

            <complexType name="Name">
                <sequence>
                    <element name="first" type="string"/>
                    <element name="last" type="string"/>
                </sequence>
            </complexType>

            <simpleType name="FrequentFlyerUsername">
                <restriction base="string"/>
            </simpleType>


            <complexType name="Airport">
                <all>
                    <element name="code" type="tns:AirportCode"/>
                    <element name="name" type="string"/>
                    <element name="city" type="string"/>
                </all>
            </complexType>

            <simpleType name="AirportCode">
                <restriction base="string">
                    <pattern value="[A-Z][A-Z][A-Z]"/>
                </restriction>
            </simpleType>


            <complexType name="Ticket">
                <all>
                    <element name="id" type="long"/>
                    <element name="issueDate" type="date"/>
                    <element name="passengers">
                        <complexType>
                            <sequence>
                                <element maxOccurs="9" name="passenger" type="tns:Name"/>
                            </sequence>
                        </complexType>
                    </element>
                    <element name="flight" type="tns:Flight"/>
                </all>
            </complexType>

            <simpleType name="ServiceClass">
                <restriction base="NCName">
                    <enumeration value="economy"/>
                    <enumeration value="business"/>
                    <enumeration value="first"/>
                </restriction>
            </simpleType>

        </schema>
    </wsdl:types>
    <wsdl:message name="BookFlightRequest">
        <wsdl:part element="schema:BookFlightRequest" name="BookFlightRequest"/>
    </wsdl:message>
    <wsdl:message name="GetFlightsResponse">
        <wsdl:part element="schema:GetFlightsResponse" name="GetFlightsResponse"/>
    </wsdl:message>
    <wsdl:message name="BookFlightResponse">
        <wsdl:part element="schema:BookFlightResponse" name="BookFlightResponse"/>
    </wsdl:message>
    <wsdl:message name="GetFrequentFlyerMileageRequest">
        <wsdl:part element="schema:GetFrequentFlyerMileageRequest" name="GetFrequentFlyerMileageRequest"/>
    </wsdl:message>
    <wsdl:message name="GetFlightsFault">
        <wsdl:part element="schema:GetFlightsFault" name="GetFlightsFault"/>
    </wsdl:message>
    <wsdl:message name="GetFlightsRequest">
        <wsdl:part element="schema:GetFlightsRequest" name="GetFlightsRequest"/>
    </wsdl:message>
    <wsdl:message name="GetFrequentFlyerMileageResponse">
        <wsdl:part element="schema:GetFrequentFlyerMileageResponse" name="GetFrequentFlyerMileageResponse"/>
    </wsdl:message>
    <wsdl:portType name="Airline">
        <wsdl:operation name="BookFlight">
            <wsdl:input message="tns:BookFlightRequest" name="BookFlightRequest"/>
            <wsdl:output message="tns:BookFlightResponse" name="BookFlightResponse"/>
        </wsdl:operation>
        <wsdl:operation name="GetFrequentFlyerMileage">
            <wsdl:input message="tns:GetFrequentFlyerMileageRequest" name="GetFrequentFlyerMileageRequest"/>
            <wsdl:output message="tns:GetFrequentFlyerMileageResponse" name="GetFrequentFlyerMileageResponse"/>
        </wsdl:operation>
        <wsdl:operation name="GetFlights">
            <wsdl:input message="tns:GetFlightsRequest" name="GetFlightsRequest"/>
            <wsdl:output message="tns:GetFlightsResponse" name="GetFlightsResponse"/>
            <wsdl:fault message="tns:GetFlightsFault" name="GetFlightsFault"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="AirlineBinding" type="tns:Airline">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="BookFlight">
            <soap:operation soapAction=""/>
            <wsdl:input name="BookFlightRequest">
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="BookFlightResponse">
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="GetFrequentFlyerMileage">
            <soap:operation soapAction=""/>
            <wsdl:input name="GetFrequentFlyerMileageRequest">
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="GetFrequentFlyerMileageResponse">
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="GetFlights">
            <soap:operation soapAction=""/>
            <wsdl:input name="GetFlightsRequest">
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="GetFlightsResponse">
                <soap:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="GetFlightsFault">
                <soap:fault name="GetFlightsFault" use="literal"/>
            </wsdl:fault>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="AirlineService">
        <wsdl:port binding="tns:AirlineBinding" name="AirlinePort">
            <soap:address location="http://localhost:8080/"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>