cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming APC from UI5 Application running on BTP-CF

ChrisTh
Explorer
976

Hello Experts,

I am struggling to create a websocket connection from my UI5 Application deployed on BTP (central launchpad) via CloudConnector to ABAP on-premise system (APC).

Here are some details:
SAP Cloud Connector Version: 2.14.0.1.(WebSocket checkbox is checked for the relevant host, resources are accessible)
ABAP System Version: SAP_BASIS 756
BTP-Subaccount-Destination could be accessed via BAS and works fine forall OData V2 requests

My UI5 application works as expected when I deploy it directly onto my ABAP system. As soon as I deploy it into my CloudFoundry space on BTP and try to connect to my apc channel the following error occurs:

WebSocket-dbg.js:409 WebSocket connection to 'wss://<my-prefix>.launchpad.cfapps.eu10.hana.ondemand.com/sap/bc/apc/sap/<my-apc-service>' failed:

OData requests to the same system work fine.

As we use the default managed app router of BTP-CF I added the following lines to my xs-app.json file:

  "websockets": {
"enabled": true
}

This is how I try to establish the connection:

jQuery.sap.require("sap.ui.core.ws.SapPcpWebSocket");
this.oWs = new sap.ui.core.ws.SapPcpWebSocket("/sap/bc/apc/sap/<my-apc-service>",sap.ui.core.ws.SapPcpWebSocket.SUPPORTED_PROTOCOLS.v10);
Are there any configuration steps I am missing? Do I for example need to create a separate destination for APC-web-socket-connections and add an additional route in xs-app.json?
Many thanks in advance,
Chris

Accepted Solutions (0)

Answers (1)

Answers (1)

gregorw
SAP Mentor
SAP Mentor
0 Kudos

Hi Christoph,

have you tried using the standalone approuter? Maybe the managed approuter despite the description from hschaefer123.

CU
Gregor

ChrisTh
Explorer

Hello Gregor,
thank you for your reply.

My technical-support-department sent me several log files of our CloudConnector, WebDispatcher and ICM. I saw my requests on all those systems.
Inside those logs I saw that the origin header of the request did not contain port information. My cross-system-origin whitelist was maintained for port 443. I deleted the port from the whitelist and was able to establish the connection some minutes ago.

Best regards,
Chris