VB.NET Sample 1:
Requesting an Air Availability

Step 1 creates a general air availability request using the XML AirAvailability_6_2 transaction. The sample uses the minimum request parameters needed for availability of a one-way trip (single air segment) in 90 days from the current date from Denver International Airport in Denver to O'Hare International Airport in Chicago. Currently, availability requests can be made only through transactions in the XML Select Web Service.

  1. Create a proxy of the XML Select Web Service, using a WSDL for your region or service level. For example:
    https://americas.copy-webservices.travelport.com/B2BGateway/service/XMLSelect?WSDL
    .

  2. Create a function, XWSController, which formats an XML template and sets the parameters for the request. The following code also contains proxy server credentials that are included with the request to bypass the firewall.

Declares the required namespaces.

Imports System

Imports System.Net

Imports System.Xml

Imports GettingStarted.com.galileo.testws

 

Namespace GettingStarted

 

 

Declares the XWSController class, which manages the XML Select Web Service request.

Public Class XWSController

 

 

No constructor logic is required.

Public Sub New()

 

End Sub

 

 

Builds the request DOM from a string, using fixed end points and the required date (+90 days).

Public Function BuildRequest() As XmlDocument

Creates a new DOM.

Dim doc As XmlDocument = New XmlDocument()

Finds the date in +90 days.

Dim tomorrow As DateTime = DateTime.Today.AddDays(90.0)

 

 

XML Select AirAvailability_6_2 transaction. See the AirAvailability_6_2 Sample Request for complete request parameters.

Dim req As String = "<AirAvailability_6_2>" + vbCrLf

Air availability request.

req += "    <AirAvailMods>" + vbCrLf

General air availability.

req += "        <GenAvail>" + vbCrLf

Number of seats.

req += "            <NumSeats>1</NumSeats>" + vbCrLf

Preferred class of service. If no specific class of service is requested, a CDATA structure is used to force a blank. The CRS will not process a zero value for this element.

req += "            <Class><![CDATA[ ]]></Class>" + vbCrLf

Departure date for the flight segment. The CRS processes dates in a yyyyMMdd format.

req += "            <StartDt>" + tomorrow.ToString("yyyyMMdd") + "</StartDt>" + vbCrLf

Departure airport or city. Metro codes can be denoted with an asterisk, e.g., LAX*.

req += "            <StartPt>DEN</StartPt>" + vbCrLf

Destination airport or city.

req += "            <EndPt>ORD</EndPt>" + vbCrLf

Departure time at noon in a 24-hour clock, HHMM.  
Blank
for CRS default.

req += "            <StartTm>1200</StartTm>" + vbCrLf

Time Window Indicator specifies if a time window applies to a D (departure time/date) or A (arrival time/date).

req += "            <TmWndInd>D</TmWndInd>" + vbCrLf

Start and End Time of Departure/Arrival Window. Values in a 24-hour clock, HHMM.
Blank
if not used.

req += "            <StartTmWnd>0800</StartTmWnd>" + vbCrLf

req += "            <EndTmWnd>1400</EndTmWnd>" + vbCrLf

Flight type preference.
Blank
if no preference.

req += "            <FltTypeInd></FltTypeInd>" + vbCrLf

Start point indicator.
Specifies the allowed departure airports.
B
(Select the specified airport first, then expand to other airports in a multi-airport city.)
Blank
(Use CRS default.)

req += "            <StartPtInd></StartPtInd>" + vbCrLf

End point indicator.
B
(Destination as entered, either city or airport. This option expands airports to cities, giving preference to specified airport. For example, LAX would be processed as an airport.)
Blank
(Default to B).

req += "            <EndPtInd></EndPtInd>" + vbCrLf

Ignore TravelScreen preferences.
Y
(Ignore TS preferences)
N
(Do not ignore TS preferences)
Blank
(Default to N)

req += "            <IgnoreTSPref></IgnoreTSPref>" + vbCrLf

End of general availability.

req += "        </GenAvail>" + vbCrLf

End of availability request.

req += "    </AirAvailMods>" + vbCrLf

End of XML Select transaction.

req += "</AirAvailability_6_2>" + vbCrLf

Loads the XML string into the DOM.

doc.LoadXml(req)

Returns the DOM.

Return doc

 

End Function

 

 

Builds a default filter that returns all available data.

Public Function BuildFilter() As XmlDocument

 

Dim doc As XmlDocument = New XmlDocument()

A wildcard filter returns all data.

doc.LoadXml("<_/>")

 

Return doc

 

End Function

 

 

Makes the availability call.

Public Function doAvail(ByVal xmlRequest As XmlDocument, ByVal xmlFilter As XmlDocument) As XmlElement

 

Dim xws As XmlSelectWebService = New XmlSelectWebService()

Creates and sets up the credentials for the XML Select Web Service. User name and password are assigned by Galileo.

The XML Select Web Service uses Basic Authentication, however, Windows XP defaults to Digest Authentication.

Dim UserName As String = "UserName"

Dim Password As String = "Password"

Dim credentials As NetworkCredential = New NetworkCredential(UserName, Password)

Dim cc As CredentialCache = New CredentialCache()

cc.Add(New Uri(xws.Url), "Basic", credentials)

xws.Credentials = cc

Sets up a WebProxy to get through the firewall, if necessary.

Dim wp As WebProxy = New WebProxy()

URL of the proxy server. Confirm that the appropriate port is included.

wp.Address = New Uri("http://yourproxy.company.com:80")

 

wp.BypassProxyOnLocal = True

The User ID, password, and domain for the proxy server.

wp.Credentials = New NetworkCredential("userID", "password", "proxyDomain")

 

xws.Proxy = wp

Specifies the Document (root) XML element for the request and filter. This example uses the SubmitXML method.

A Host Access Profile is required to access Galileo Web Services.

Dim xmlResponse As XmlElement = xws.SubmitXml("HostAccessProfile", xmlRequest.DocumentElement, xmlFilter.DocumentElement)

Returns the response data as an XML element.

Return xmlResponse

 

End Function

 

End Class

 

End Namespace

 

  1. The Apollo or Galileo CRS returns 16 segments in an XML Select air availability response. The following code shows an example of the air availability summary for all segments as well as the first actual response segment. The complete response with all returned segments is available on the Galileo Web Services Sample Site. See the AirAvailability_6_2 Sample Response for complete response parameters.

XML Select AirAvailability_6_2 transaction.

<AirAvailability_6_2 xmlns="">

Air availability response.

<AirAvail>

When additional response segments are available, a More token is returned. A specific More token can only be used once. After each follow-on request, a new token is returned to be used for the next follow-on request.

<MoreToken>

<Tok>301060172164629495103170495884</Tok>

</MoreToken>

Summary of returned segments.

<AvailSummary>

The total number of direct and connecting flight segments in response. The default number of availability responses is 16.

<NumSegs>16</NumSegs>

Airport or city code of the customer embarkation. Left justified, blank filled.

<StartPt>DEN</StartPt>

City code for requested origin city or airport.

<StartCity>DEN</StartCity>

Destination airport or city code.

<EndPt>ORD</EndPt>

City code for requested destination city or airport.

<EndCity>CHI</EndCity>

Error codes.

<ErrInd>0</ErrInd>

<ErrNum>0</ErrNum>

End of summary.

</AvailSummary>

Begin data for the first flight segment.

<AvailFlt>

Airline carrier (vendor) code.

<AirV>UA</AirV>

Flight number.

<FltNum>262</FltNum>

Optional suffix.
Reserved. Currently ignored.

<OpSuf />

Departure date of segment in YYYYMMDD format.

<StartDt>20020926</StartDt>

Departure airport code.

<StartAirp>DEN</StartAirp>

Destination airport code.

<EndAirp>ORD</EndAirp>

Departure time of this segment in a 24-hour clock HHmm.

<StartTm>1135</StartTm>

Arrival time of this flight segment in a 24-hour clock HHmm.

<EndTm>1455</EndTm>

Day change indicates the difference between departure and arrival dates. -1, 00, 01, 02 are valid.

<DayChg>00</DayChg>

Connection indicates that this flight segment connects to the next segment in the response.
Y
(Yes - flight connects to next segment)
N
(No)

<Conx>N</Conx>

Indicates a change of airport (crosstown) connection at the Board point. Not applicable to the first flight segment of a connection.

<AirpChg>N</AirpChg>

Aircraft type. CHG indicates an aircraft change.

<Equip>777</Equip>

Reserved for future use. Currently ignored.

<Spare1 />

Number of intermediate stops between board and off points.

<NumStops>0</NumStops>

Indicates whether the carrier above differs from the carrier which actually operates the flight (code share).

<OpAirVInd>N</OpAirVInd>

On time performance indicator.
9
(90 to 100 percent),
8
(80 to 89.9 percent),
etc.

<Perf>8</Perf>

Type of sell agreement between CRS and link carrier.
SS
Secured Sell
Blank
(no agreement)

<LinkSellAgrmnt>SS</LinkSellAgrmnt>

Indicates if carrier has link (carrier-specific) display option.

<DispOption>Y</DispOption>

Indicates if carrier has Inside (polled ) Availability option.

<InsideAvailOption>L</InsideAvailOption>

General traffic restriction indicators.

<GenTrafRestriction />

Contains a Y or an N for each day of the week starting with Sunday. Y indicates that the flight operates for that day of the week.

<DaysOperates>YYYYYYY</DaysOperates>

Total flying time (in minutes) for all segments of the journey.

<JrnyTm>140</JrnyTm>

Arrival Date in YYYYMMDD format.

<EndDt>20020926</EndDt>

Code share: Airline code for the carrier that actually operates this flight. Blank if no code share.

<OpAirV />

The operating carrier's flight designator for this flight. Blank if no code share.

<OpFltDesignator />

Reserved for future use. Currently ignored.

<OpFltSuf />

Used only for  Flight-Specific Timetable.

<StartTerminal />

Used only for Flight-Specific Timetable.

<EndTerminal>1</EndTerminal>

Elapsed flight time in minutes.

<FltTm />

Indicates Last Seat Availability capability.

<LSAInd>N</LSAInd>

Carrier is a Galileo Participant.

<GalileoAirVInd>Y</GalileoAirVInd>

End data for first flight segment.

</AvailFlt>

Begin flight availability status.

<FltAvailStatus>

Indicates the operational status of this flight segment.

<FltStatus />

Indicates whether seats are available in First, Business, and Coach class, respectively.

A Seats are available
L
Waitlist open
C
Waitlist closed
N
Seats NOT available
R
Seats only available on request to airline

<First>A</First>

<Business>A</Business>

<Coach>A</Coach>

End of flight availability status.

</FltAvailStatus>

Begin booking code availability.

BIC (Booking Indicator Code) is the same as Class of Service.

 

<BICAvail>

Multiple BIC statuses may be listed, depending on the parameters of the availability request.

<BICStatusAry>

<BICStatus>

Booking Indicator Code (Class of Service).

<BIC>F</BIC>

The number of available seats for the class of service.

 

<Status>006</Status>

End of BIC status.

</BICStatus>

End of array.

</BICStatusAry>

End of Booking Indicator Code availability.

</BICAvail>

 

...

 

  1. The response data is used to book an air reservation in Sample 2.