Skip to Content

Maintain connection in SAP Cloud Platform mobile services

Dear Folks,

I have build a UI5 App on SAP Cloud Platform which uses an oData services from an ABAP backend connected via Cloud Connector. This workes fine, when starting the app you have to enter your credentials (from the backend).

Now I deployed this app to the HCP mobile services using the Hybrid application toolkit. I tried several setting, but I can not read the data from the backend.

I maintained the connection in the HCPms cockpit as follows:

a) Proxy-Type OnPremise, URL as used in the HCP UI5 App
-> When I start the App on the android-phone, there is a login promt, but the credentials are not accepted

b) Proxy-Type Internet, URL https://ui5app-account.dispatcher.hana.ondemand.com/ /sap/opu/odata/sap/myservice /
This URL can be called via browser without any problems.
When I start the app on the android-phone no data are displayed. I tried several SSO Options (basic auth, app-to-app-sso, no auth) but nothing works.

I hope that someone has a good documentation on how to connect backend systems to HCPms.

Many thanks in advance and

Best regards
Dominik

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 20, 2017 at 01:31 PM

    When using hcpms the data connection is proxy through it, so the url would be https://<hcpms server:port>/<your app id>/<entityset>. To get an understanding on kapsel and hcpms see

    https://blogs.sap.com/2015/07/17/getting-started-with-kapsel-part-1-sp09/

    and

    https://blogs.sap.com/2015/11/27/develop-hybrid-mobile-apps-with-sap-web-ide/

    Regards,

    Jamie

    SAP - Technology RIG

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Jamie

      after installing finding the correct ADB Driver I could use the chrome remote debugging tool.

      When using the url https://<hcpms server:port>/<your app id>/ the S-User / Password is send to the Backend-URL via http Basic authentication. This doesn't work without maintaining the principal propagation.

      I deleted some lines from the Mobile App ComponentController, after that the connection worked.

      var oHeader = { "X-SMP-APPCID": appContext.applicationConnectionId };
      
      		//if (appContext.registrationContext.user) {
      		//	oHeader.Authorization = "Basic " + btoa(appContext.registrationContext.user + ":" + appContext.registrationContext.password);
      		//}
      		oModel = new sap.ui.model.odata.ODataModel(url, true, null, null, oHeader);
      		this._setModel(oModel);
      
  • Mar 21, 2017 at 11:05 AM

    Hi Jamie

    thank you for your answer. I used follwing blog to connect the HCPms to my ABAP backend:
    https://blogs.sap.com/2015/02/03/how-to-use-hcpms-with-an-abap-system/

    Although the UI5 App work's fine in the WebIDE, the Hybrid App doesn't.
    The backend URL is http://virtualhostname/sap/opu/odata/servicename/ which is exactly the same in the Destination on SAP Cloud Platform.
    Is there any change to trace the connectivity?

    Best regards
    Dominik

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 23, 2017 at 02:32 PM

    The connection in hcpms should be pointing to the cloud connection url, I think this is what you mentioned in "a". You should be able to use your browser to trace the connectivity. For example

    https://developers.google.com/web/tools/chrome-devtools/remote-debugging/

    Regards,

    Jamie

    SAP - Technology RIG

    Add comment
    10|10000 characters needed characters exceeded