Skip to Content

How to set and use destinations in XSA | Cloud Foundry

Nov 21, 2017 at 11:38 AM


avatar image

I have a scenario where I am developing UI5 apps and deploying them in HANA XSA (on premise).


v1.0.55 (built 2017-04-10)

Although the UI5 code is inside HANA XSA, the backend service is hosted in a different environment - so I need a destination to call some REST and oData APIs.

I created two different spaces in my HANA XSA Organization: the objective is to use one space for development purposes (SPACE_DEV) and the other one for production (SPACE_PROD).

Similarly, the backend has two different environments for development (API_DEV) and production (API_PROD).

So, I would like that the apps deployed in SPACE_DEV end up calling API_DEV and when they are deployed to SPACE_PROD end up calling API_PROD.

There is some information about manifest.yaml, xs-app.json and destinations but always those examples consider that the backend is a module in the same MTA app where the front end is in.

The (only) most similar question I have found at the community is below - but I do not have a back end service in HANA on which I would need to call an REST API.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Florian Pfeffer
Nov 21, 2017 at 06:52 PM

A user provided service is not only restricted for calls to a HANA "backend". With a user-provided service you can create a "service" for nearly every endpoint.

In the OpenSAP course (v5) for HANA development there was an example to use the external UI5 library of the CDN. The create command can be found here. If you check the mta.yaml file, you see that the ups is consumed as resource which is required by the web module (not really anymore, cause it was replaced by the HANA provided UI5 lib, but you can see the commented config lines in the file). In the index.html file of the web module you can see that the ui5liburl property is replaced by the real URL using the {{{ }}} replacement syntax.

In a Node.js or Java module (or BYOL module) you are able to read such values via the VCAP_SERVICES environment variable.

The same way you can consume your REST service.


Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Florian, thanks for the answer.

I will try this out today. As my understanding, this cups command would be used in different spaces with different URLs, right? (In order to differentiate back end systems for each space)

Thank for now. I will be back


Hi Florian,

I did this, but i'm having an error of authentication.

My .NET API needs Bearer authentication, and i'm passing it on HTTP header request.

I've already did set the Authorization as 'none' in xs-app.json and executing the application as stand-alone works fine, but when i tried to execute it inside a Launchpad, the router is tring to authenticate the Bearer token into Hana and returns me a HTTP 401 Authorization error.

Any idea of what this could be?


Matheus Oliveira Goulart Mar 12 at 12:02 PM
10 |10000 characters needed characters left characters exceeded