Setting Proxy Server Credentials in Apache AXIS

In Apache Axis, the system properties can be configured at an application level to support a proxy server, so that the proxy server credentials do not need to be explicitly included in each call to Galileo Web Services.

 

public static void main(String[] argv)

 

{

System Properties

Comment this line to make a call through a proxy server.

//System.getProperties().put("proxySet","false");

Set the system properties at an application level.

System.getProperties().put("proxySet","true");

Include the authentication credentials for the local proxy server.

The proxyUser and proxyPassword fields can be commented out if the proxy server does not require authentication.

System.getProperties().put("http.proxyHost", "localhost");

System.getProperties().put("http.proxyPort",
"8000");     System.getProperties().put("http.proxyUser",
"proxyUser");

System.getProperties().put("http.proxyPassword",
"proxyPassword");

Sample Call
In this example, a Cancel Trip call is made to the Reservation Builder eBL.

 

Instantiate the proxy locator.

com.galileo.ws.GwsBookingLocator bservice = new com.galileo.ws.GwsBookingLocator();

Use the Reservation Builder eBL to get a stub that implements the SDI (Service Definition Interface).

bws = (GwsBookingSoapStub)bservice.getgwsBookingSoap(new java.net.URL("URL"));

Include the User Name and Password for Galileo Web Services that are assigned by Galileo.

bws.setUsername("UserName");

bws.setPassword("Password");

The record locator for the PNR/Booking File.

String recordLocator = "TEST";

Send the Cancel Trip request. The response is returned as an XML element.

A Host Access Profile is required to access the Galileo Web Services. The "P" value indicates that the cancellation request was received from a Passenger.

Element cancelResult = bws.cancelTrip("HostAccessProfile", recordLocator, "P");

 

}