I want to create my first Red App for sabre with eclipse

I'm new in this environment and I want to create my first red app, But I need some help to connect the web services for sabre , Can you help me with a example for starting in this? I have instaled the Eclipse RCP that sabre has in their page and configured it, but dont have an idea of how to start.

Thank You very much.

Upvotes: 0

Views: 479

Answers (1)

alexandre meneghello
alexandre meneghello

Reputation: 21

I would suggest the com.sabre.redapp.example.cf.sws RedApp that comes bundled on the RedApp SDK samples folder.

Mainly, for consuming Sabre WebServices, you'll be using Communication Framework classes from RedApp SDK, which allows u to consume the services without being worried with low level communications, that is, most of your development efforts will be to create and parse the XML payloads, consuming the services using java is very straightforward :

// Set actionName to the correct Sabre Web Services action name
String actionName = "OTA_AirAvailLLSRQ***"; 

// Retrieve a reference to ISRWCommunication
ISRWCommunication com = Activator.getDefault().getServiceReference(ISRWCommunication.class);

// Create the request
SWSRequest request = new SWSRequest();
request.setAction(actionName);
request.setPayload(payload);

// Send the request
SWSServiceClient client = new SWSServiceClient(com);
ClientResponse <SWSResponse> rsp = client.send(request); 

// Retrieve the response
if (rsp.isSuccess()) {      
    SWSResponse response = rsp.getPayload();
    // Response for the sent request 
    Document responsePayload = response.getResponse(); 
}

*** don't forget to Authorize the service usage on redapp.xml file :

<Authorization name="com.sabre.edge.cf.sws.SWS" metric="tpm">
    <Action name="OTA_AirAvailLLSRQ" threshold="3" />
</Authorization>

Upvotes: 2

Related Questions