Skip Navigation

com.sabre.redapp.example.cf.sws Sample

The com.sabre.redapp.example.cf.sws sample demonstrates sending and wrapping a Sabre Web Services request using the Sabre Web Services communications service. It locks the session while the service is running with the com.sabre.edge.cf.host.Locking (locking) service.

The following describes the files that this sample includes:

  • Activator.java gets an instance of SRWRuntime and uses tokenService to request the authentication token.

  • SwsView.java builds a view to demonstrate using the Sabre Web Services service to send a request for air availability. The Web Services action code for air availability requests is passed.

        Methods in this class lock the TA session while the SWS communications service is running, and these methods unlock the session when the service is done. These methods also send the sample.xml request payload, get the response document, and convert the response object to a string. Additionally, this code gets a parser.

  • sample.xml is a request payload for air avail from Las Vegas to Los Angeles on a specific date.

  • redapp.xml requests authorization to use the Sabre Web Services and locking communications services.

Running the Sample

  1. In Eclipse, import the com.sabre.redapp.example.cf.sws plug-in into your workspace and add it to your run configuration.

  2. Launch Sabre Red 360 from your run configuration and log in with your CERT Sabre ID.

  3. Log in to the Sabre host using Sabre emulator.

  4. From Tools > Other on the launcher bar, open Example View.

  5. Click Lock, and then click SendSWSRequest several times. The request is sent to Sabre Web Services.

  6. Wait several seconds to see the response payload from Sabre Web Services, formatted as XML. Click Unlock.

The following figure shows the response payload.

image48