After retrieving flight information in Sample 3, cancel the booked air reservation. Cancel calls can be made through either the Reservation Builder eBL or a combination of transactions in the XML Select Web Service. In this example, the cancel call is made through a call to the Reservation Builder eBL.
Submit the cancellation request, using the record locator from the Reservation Builder eBL response in Step 2. The cancel function is included as part of the same BWSController class that requested the reservation in Sample 2.
The cancellation request. recLoc is the record locator for the PNR/BF that is returned in the <Success> element of the booking response. RecFrom is the individual/party who received the cancellation. |
Public Function doCancel(ByVal recLoc As String, ByVal recFrom As String) As XmlNode |
|
Dim bws As gwsBooking = New gwsBooking() |
Creates and sets up the credentials for the Reservation Builder eBL. User name and password are assigned by Galileo. The Reservation Builder eBL 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(bws.Url),"Basic",credentials) | |
bws.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") |
wp.BypassProxyOnLocal = True | |
The User ID, password, and domain for the proxy server. |
wp.Credentials
= New NetworkCredential("userID","password", |
bws.Proxy = wp | |
Specifies
the Document (root) XML element for the request and filter. This example
uses the CancelTrip method. |
Dim
xmlResponse As XmlNode = bws.CancelTrip("HostAccessProfile",
|
Returns the response data as an XML element. |
Return xmlResponse |
|
End Function |
The response confirms the record locator of the cancelled PNR/BF.
The Reservation Builder eBL response. |
<Response Time="Monday, 30 September 2002 17:05:35" ServiceBuildVersion="1.0.40.0" xmlns="http://ns.galileo.com">) |
A successful cancellation returns the record locator. |
<Success>ZM794Q</Success> |
|
</Response> |