2015-06-05 50 views

回答

2

我會建議捆綁在RedApp SDK示例文件夾中的com.sabre.redapp.example.cf.sws RedApp。

主要是,爲了使用Sabre WebServices,您將使用RedApp SDK中的通信框架類,它允許您使用服務而不用擔心低級別的通信,也就是說,您的大部分開發工作將是創建並解析XML有效載荷,用java消費的服務是非常簡單的:

// 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(); 
} 

***不要忘了對授權文件redapp.xml服務利用狀況:

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