Communicating with SAP Mobile Server Through a Reverse Proxy

Connect to SAP Mobile Server through a Reverse Proxy using Relay Server or the Apache Web server.

The Object API application can communicate with SAP Mobile Server:
  • Directly
  • Through Relay Server by specifying:
    • Just the FarmID
    • Just the URL suffix
    • Both the FarmID and URL suffix
  • Through a Reverse Proxy by specifying only the URL suffix - you can configure the reverse proxy in such a way that the device communicates to http://server:port/customcontext/tm or /tm2 when communicating with SAP Mobile Server. "FarmID" has no meaning when using a Reverse Proxy. In this case, use only the URL suffix and leave "FarmID" empty.
    Note: You can also use the custom context with the Relay Server when using Apache.

Connecting to SAP Mobile Server Through a Reverse Proxy Using Relay Server:

// Register:
    Application.getInstance().getConnectionProperties().setUrlSuffix
      ("/ias_relay_server/client/rs_client.dll/$messaging-farmId$")
    // (e.g. /ias_relay_server/client/rs_client.dll/mega-vm008.msg) 

//Synchronize:
    TestDB.getSynchronizationProfile().getStreamParams().setUrl_Suffix
       ("/ias_relay_server/client/rs_client.dll/$replication-farmId$")
    // (e.g. /ias_relay_server/client/rs_client.dll/mega-vm008.rep)

Connecting to SAP Mobile Server Through a Reverse Proxy Using Apache Web Server as Proxy Server:

Add to the httpd.conf file:
content: Listen 80 <VirtualHost *:80> 
ServerName proxy-server  
<Location /app1/>
ProxyPass http://sup-server:5001/ ProxyPassReverse
http://sup-server:5001/ 
</Location> 
<Location /app2/> 
ProxyPass http://sup-server:2480/
ProxyPassReverse http://sup-server:2480/
</Location> 
</VirtualHost> 

// Register:      
Application.getInstance().getConnectionProperties().setUrlSuffix("/app1"); 

//Synchronize:
TestDB.getSynchronizationProfile().getStreamParams().setUrl_Suffix("/app2");