1. Define a schema for a flight availability request application that requests f
ID: 3761422 • Letter: 1
Question
1. Define a schema for a flight availability request application that requests flight availability for a city pair on a specific date for a specific number and type of passengers. Optional request information can include: time or time window, connecting cities, client preferences, e.g., airlines, flight types, etc. The request can be narrowed to request availability for a specific airline, specific flight, or specific booking class on a specific flight.
2. Write a simple SOAP program that returns information about commercial flights from the XML Schema in 1 above
Explanation / Answer
Sample flightavailableRequest XSD:
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="flightavailableRequest">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="source"/>
<xs:element type="xs:string" name="destination"/>
<xs:element type="xs:int" name="numberOfPassengers"/>
<xs:element type="xs:date" name="time"/>
<xs:element type="xs:string" name="clientpreferences"/>
<xs:element type="xs:string" name="specificAirline"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Below is the sample wsdl:
<definitions name="FlightService"
targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="FlightServiceRequest">
<part name="firstName" type="xsd:string"/>
</message>
<message name="FlightServiceResponse">
<part name="greeting" type="xsd:string"/>
</message>
<portType name="Hello_PortType">
<operation name="sayHello">
<input message="tns:FlightServiceRequest"/>
<output message="tns:FlightServiceResponse"/>
</operation>
</portType>
<binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sayHello">
<soap:operation soapAction="sayHello"/>
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:helloservice"
use="encoded"/>
</input>
<output>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:helloservice"
use="encoded"/>
</output>
</operation>
</binding>
<service name=" FlightService_Service">
<documentation>WSDL File for HelloService</documentation>
<port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address
location="http://www.examples.com/FlightEnquiry/" />
</port>
</service>
</definitions>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.