Developer

The SDK is Unaware of Rewrite Mode Setting

Problem

The SDK is unaware of how Rewrite Mode is configured on the server. So the endpoint URL cannot return the correct value if the server is not configured appropriately. When defining back-end connections for a selected application (described in the topic Defining Back-End Connections in the Management Cockpit Administrator documentation), the Rewrite Mode field requires the Administrator to select one of:
  • Rewrite URL in SMP – in request and response messages, server replaces all back-end URLs with the server URL.
  • Rewrite URL in Backend System – the back end rewrites the URLs. The server forwards its host name and port to the back end as an HTTP header, and the back end creates the URL to retrieve back-end entities.
  • No Rewriting – request and response messages are not modified; server passes messages directly between clients and the back end.
And states that: To enable applications using an external back end to run offline, you must select one of the rewrite options.

Fix

The SDK is unaware of how Rewrite Mode is configured on the server. So the endpoint URL cannot return the correct value if the server is not configured appropriately. The application developer and Administrator must coordinate and communicate the Rewrite Mode settings.

For example, if your application code includes an endPointURL used as the service root for Rewrite Mode, and expects the server to replace the back-end URL with the server URL:
LogonCoreContext lgCtx = LogonCore.getInstance().getLogonContext();
String endPointURL = lgCtx.getAppEndPointUrl();
URL url = new URL(endPointURL);
TraceLog.d("openOfflineStore: appcid:"+ lgCtx.getConnId());
TraceLog.d("openOfflineStore: endpointurl:"+ endPointURL)
And the server is configured for No Rewriting, this may appear as a failure, when it is actually a configuration issue.