cancel
Showing results for 
Search instead for 
Did you mean: 

WebSocket implementation in SAPUI5 fails, error 404.

0 Kudos

Hello guys,

I have created an ABAP Push Channel, and i have an SAPUI5 application. I have tested the APC, and it is working , using the dedicated RUN button in the system. The problem is when i try to create the WebSocket in SAPUI5, it gives me an error. As an argument i placed the service path of the APC created in my system. I think i'm missing something but i am not sure what. I have followed the example from "ABAP to the future " book, which is a 2016 book(might be too old). I think it might be something related to the protocol i use , but i don't know other alternative.

The error i receive:

WebSocket connection to 'wss://webidetesting8473768-mxxxxxxtrial.dispatcher.hanatrial.ondemand.com/sap/bc/apc/sap/zapc_test' failed: Error during WebSocket handshake: Unexpected response code: 404

This is my code, written in the onInit():

jQuery.sap.require("sap.ui.core.ws.WebSocket");
this.oWs = new sap.ui.core.ws.WebSocket('/sap/bc/apc/sap/zapc_test');
ibibhu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

"404" - Server Not Found , to verify the URL please try below

Please try this from the web browser and see are you able to access the web serviceshttp:;//<host http://<Host frioi system>:4XX/sap/bc/apc_test/ping

For the reference please check the below
https://blogs.sap.com/2016/06/09/abap-channels-examples/

Regards,
Bibhu

0 Kudos

Unfortunatelly, from what i see here(https://blogs.sap.com/2015/09/07/abap-push-channel-messaging-channel-and-sapui5-demo-application/) html5 doesn't support WebSockets. Please correct me if i'm wrong but this means that a WebSocket cannot be used in SAPUI5 no more?

ibibhu
Product and Topic Expert
Product and Topic Expert
0 Kudos

HTML5 , UI5 both supports websockets

Accepted Solutions (0)

Answers (0)