Sending highlight request to Emulator
You need a working Red App project with an Activator class.
-
Using Eclipse, add the following required dependencies:
-
com.sabre.edge.cf.core
-
com.sabre.edge.cf.model
-
com.sabre.edge.cf.emu
-
-
Add the following Java code to consume a service that is registered with SRWRuntime.
-
Obtain a reference to ISRWCommunication service:
ISRWCommunication com = Activator.getDefault().getServiceReference(ISRWCommunication.class);
-
Create an instance of HighlightExtractorServiceClient class and call send() method with an instance of EmuHighlightRequest class.
ClientResponse <EmuHighlightResponse> rsp = new HighlightExtractorServiceClient(com).send(new EmuHighlightRequest());
-
Retrieve a response to ClientResponse <EmuHighlightResponse> reference. This class provides simply methods isSuccess() to check for status, getErrors() retrieving errors (if occurred) and getPayload()to obtain a response.
if (rsp.isSuccess())
{
showMessage(rsp.getPayload().getText());
}
-
Create your redapp.xml configuration file and add an Authorization entry to the file to use the host communications service.