Description: C:\_WORK\ST_Repository\app\DemoApplication\app\HelpPage\dot_trans.gif

Description: C:\_WORK\ST_Repository\app\DemoApplication\app\HelpPage\dot_trans.gif

 

 

 

Service Test Sample Flight Application


Use the following links when creating test steps with the Sample Flight Application. For details, see the tutorial.

Web Services

WSDL Location - http://localhost:8000/Flights_SOAP?wsdl. Click here to open the WSDL in your browser.

The Web service contains the following operations:

§  CreateFlightOrder

§  GetFlights

§  GetFlightOrders

§  UpdateFlightOrder

§  DeleteFlightOrder

§  DeleteAllFlightOrders

 

REST Services and WADL methods

Resource
Operation
URL
Description

Flights

Get

http://localhost:8000/Flights_REST/Flights?DepartureCity={FlyFrom}&ArrivalCity={FlyTo}

Returns all flights matching the specified parameters. To return all flights, do not specify any parameters. This method supports XML content types and returns XML.
Example: http://localhost:8000/Flights_REST/Flights?DepartureCity=Denver&ArrivalCity=London

 

Response XML:

<ArrayOfFlight xmlns="HP.SOAQ.SampleApp" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

 <Flight>

   <Airlines>AA</Airlines>

   <ArrivalCity>Denver</ArrivalCity>

   <ArrivalTime>01:23 PM</ArrivalTime>

   <DepartureCity>London</DepartureCity>

   <DepartureTime>06:12 AM</DepartureTime>

   <FlightNumber>20279</FlightNumber>

   <Price>112.2</Price>

 </Flight>

</ArrayOfFlight>

Flight

Get

http://localhost:8000/Flights_REST/Flights/{FlightNumber}

Returns the flight details for the specified flight number. This method supports XML content types and returns XML.

 

Response XML:

<Flight xmlns="HP.SOAQ.SampleApp" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

  <Airlines>AA</Airlines>

  <ArrivalCity>Denver</ArrivalCity>

  <ArrivalTime>08:12 PM</ArrivalTime>

  <DepartureCity>Seattle</DepartureCity>

  <DepartureTime>03:12 PM</DepartureTime>

  <FlightNumber>1304</FlightNumber>

  <Price>177.47</Price>

</Flight>

FlightOrders

Get

http://localhost:8000/Flights_REST/FlightOrders?Date={YYYY-MM-DD}&CustomerName={CustomerName}&OrderNumber={OrderNumber)

Returns all flight orders that match the specified parameters. To return all flight orders, do not specify any parameters. If there is an error or no results, it returns an exception.

 

Response XML:

<ArrayOfFlightOrder xmlns="HP.SOAQ.SampleApp" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

 <FlightOrder>

   <Class>Economy</Class>

   <CustomerName>Mary Parker</CustomerName>

   <DepartureDate>2009-02-14T17:47:02</DepartureDate>

   <FlightNumber>1304</FlightNumber>

   <NumberOfTickets>20</NumberOfTickets>

   <OrderNumber>3</OrderNumber>

 </FlightOrder>

</ArrayOfFlightOrder>

  

ReserveOrder (POST)

http://localhost:8000/Flights_REST/FlightOrders/

Receives XML with the input parameters: Class, CustomerName, DepartureDate, FlightNumber, and NumberOfTickets. It creates a new flight order and returns OrderNumber and TotalPrice.
 REQUEST:
  Header:
  Content-Type: Text/xml

  Body:
  <FlightOrderDetails xmlns="HP.SOAQ.SampleApp">
  <Class>Business</Class>
  <CustomerName>John Doe</CustomerName>
  <DepartureDate>2012-12-12</DepartureDate>
  <FlightNumber>1304</FlightNumber>
  <NumberOfTickets>21</NumberOfTickets>
  </FlightOrderDetails>

 

 Response XML:

<CreatedOrderParams xmlns="HP.SOAQ.SampleApp" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

  <OrderNumber>17</OrderNumber>

  <TotalPrice>3717</TotalPrice>

</CreatedOrderParams>

FlightOrder

Get

http://localhost:8000/Flights_REST/FlightOrders/{OrderNumber}

Returns the details of a specific flight order.

 

 Response XML:

<FlightOrder xmlns="HP.SOAQ.SampleApp" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

  <Class>First</Class>

  <CustomerName>John Doe</CustomerName>

  <DepartureDate>2009-02-14T17:47:02</DepartureDate>

  <FlightNumber>6232</FlightNumber>

  <NumberOfTickets>1</NumberOfTickets>

  <OrderNumber>1</OrderNumber>

</FlightOrder>

  

Update (PUT)

http://localhost:8000/Flights_REST/FlightOrders/{OrderNumber}

Receives an XML with parameters: FlightNumber, CustomerName, Class, and NumberOfTickets Updates a flight's details and returns True or False.

 REQUEST:
  Header:
  Content-Type: Text/xml

  Body:
  <UpdateFlightOrderDetailsREST xmlns="HP.SOAQ.SampleApp">
  <FlightNumber>1304</FlightNumber>
  <CustomerName>Jone Doe</CustomerName>
  <Class>First</Class>
  <NumberOfTickets>21</NumberOfTickets>
  </UpdateFlightOrderDetailsREST>

 

 Response XML:

<boolean xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</boolean>

 

Delete

http://localhost:8000/Flights_REST/FlightOrders/{OrderNumber}

Deletes the specified flight order and returns True or False.

 

 Response XML:

<boolean xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</boolean>

 

DeleteAll

http://localhost:8000/Flights_REST/FlightOrders/All

Deletes all flight orders and returns True or False.

 

 Response XML:

<boolean xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</boolean>

Last Updated: 12-Dec-2009