这似乎是一个愚蠢的问题,但是如何确定我的 SAP SMP 2.3 服务器是否有中继服务器?
附加数据:我在尝试使用 Sap Mobile Platform 2.3 进行 HelloWorld 项目设置时获得了基本知识,我想从 Web 服务中读取几行内容。我可以访问 Sap Mobile 工作区、SAP Control Center 和运行它的虚拟机,但我没有对其进行配置,因此我对它的了解有限。到目前为止,我已经能够从 sap Web 服务中读取几行数据,并在 SMP 工作区中查看它们。我的下一步是从我的原生 Android 应用程序中读取这些行,但我正在努力确定使用哪些端口来同步我的应用程序,并且我无法将其连接到服务器。我在 Eclipse 的 logcat 上收到绿色和红色消息:“无法连接到 IP 地址 bla bla,端口 bla”。
到目前为止我的代码:
Application app = Application.getInstance();
app.setApplicationIdentifier("SMPNostrum");
app.setApplicationContext(SMPactivity.this);
Log.v("joshtag","Configuring Connection Properties");
ConnectionProperties connProps = app.getConnectionProperties();
connProps.setServerName(SERVER_137); //My server's IP
// if you are using Relay Server, then use the correct port number for the Relay Server.
// if connecting using http without a relay server, use the messaging administration port, by default 5001.
// if connecting using https without a relay server, then use a new port for https, for example 9001.
connProps.setPortNumber(SYNC_SERVER_PORT);//Port=2480
// if connecting using https without a relay server, set the network protocol
connProps.setNetworkProtocol("http");
connProps.setFarmId("0");
connProps.setActivationCode("123");
// Set FarmId and UrlSuffix when connecting through the Relay Server.
// Provide user credentials
LoginCredentials loginCred = new LoginCredentials("Samsung","my password here");
connProps.setLoginCredentials(loginCred);
connProps.setUrlSuffix("/ias_relay_server/client/rs_client.dll/%cid%/tm"); //is this necessary?
// Initialize generated package database class with this Application instance
SMPNostrumDB.setApplication(app);
ConnectionProfile cp=SMPNostrumDB.getSynchronizationProfile();
cp.setServerName(SERVER_137);
cp.setPortNumber(SYNC_SERVER_PORT);
cp.setNetworkProtocol(PROTOCOL);
cp.setDomainName("default");
cp.save();
Log.v("joshtag","Registering and connecting App");
// If the application has not been registered to the server,register now
if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED){
app.registerApplication(30000);
//iniciaSincronitzacio(app.getRegistrationStatus() != RegistrationStatus.REGISTERED, sincronizar);
}
else{
// start the connection to server
app.startConnection(30000);
}