on 04-24-2019 4:48 PM
Hello,
is it possible to establish a websocket connection through a destination?
Following Situation:
- HTML5-Application in consumer account uses a destination
- the destination points to a java backend deployed in a provider account
- the backend provides websocket endpoints and delivers data. That works fine if
a websocket connection is established to the backend directly
- if the connection is establised from the HTML5 Applicaion which uses the
destination - or if the url directly - http 404 is returned.
Does anyone kow if wss is blocked when using destinations in the neo environment?
Thanks. We created a service endpoint which returns a wss base url using:
System.getenv("HC_ACCOUNT")
System.getenv("HC_APPPLICATION")
...
...
etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert,
I don't think this would be possible. SCP's Destination API would allow you to "construct" the ws URL in Java or NodeJS. However, I don't think this would work the same in a HTML5 application directly (i.e.: using the routes in the neo-app.json file).
However, if you make the ws URL available via an service call, than you could potentially make it available to your HTML5 application via a model instance of the service.
The following example:
https://openui5.blogspot.com/2014/01/simple-chat-server-example-using-ui5.html
It uses the JavaScript class sap.ui.core.ws.WebSocket present in the UI5 to create the WebSocket object. However, it needs to pass as parameter the WS URL. This is not the same as using it from within the routes in an UI5 app.
There is also the Destination REST API, but this is not to be used inside a UI5 application because it requires an OAuth2 token (which is not safe to be retrieved via UI5).
Best regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.