0

我是这个环境的新手,我想创建我的第一个红色应用程序,但我需要一些帮助来连接 sabre 的 Web 服务,你能帮我举个例子吗?我已经安装了 sabre 在他们的页面中的 Eclipse RCP 并对其进行了配置,但不知道如何开始。

非常感谢您。

4

1 回答 1

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>
于 2015-06-08T13:15:29.940 回答