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.
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.
A sample of a proxy created by VisualStudio.NET is available at the Sample Site.
Most toolkits do not explicitly support proxies that connect to a Web Service via a secured firewall. See Connecting to Galileo Web Services for more details about working with proxy servers and other authentication issues.
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. |
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. |
req += " <StartTmWnd>0800</StartTmWnd>" + vbCrLf |
req += " <EndTmWnd>1400</EndTmWnd>" + vbCrLf | |
Flight type preference. |
req += " <FltTypeInd></FltTypeInd>" + vbCrLf |
Start point indicator. |
req += " <StartPtInd></StartPtInd>" + vbCrLf |
End point indicator. |
req += " <EndPtInd></EndPtInd>" + vbCrLf |
Ignore TravelScreen preferences. |
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. |
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 |
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. |
<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. |
<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. |
<Perf>8</Perf> |
Type of sell
agreement between CRS and link carrier. |
<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 |
<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> |
|
... |
The response data is used to book an air reservation in Sample 2.