cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error during WebSocket handshake: Unexpected response code: 403

Former Member
0 Likes
5,179

Hello everyone,

I want to implement a notification system in my SAPUI5 application developed with SAP Web IDE.

So I followed the steps described in these blogs ABAP Channels Part 1 , ABAP Channels Part 2 , ABAP Channels Part 3, and I also tried this blog Real time push notification in SAP ABAP.

But I get this error message while connecting to APC with websocket :

WebSocket connection to 'wss://webidetesting******-fiori.dispatcher.int.sap.eu2.hana.ondemand.com/sap/bc/apc/sap/ztest_apc' failed: Error during WebSocket handshake: Unexpected response code: 403

Can anyone help me please.

This is my JS code

var hostLocation = window.location, socket, socketHostURI, webSocketURI;
			
if (hostLocation.protocol === "https:") 
  socketHostURI ="wss:"; 
else
  socketHostURI = "ws:";				
  socketHostURI += "//" + hostLocation.host;
  webSocketURI = socketHostURI + "/sap/bc/apc/sap/ztest_apc" ;
			
  socket = new WebSocket(webSocketURI);
		
  socket.onopen = function() {};
			
  socket.onmessage = function(message) {
     sap.m.MessageBox.show(message.data);
  }

};

  socket.onclose = function() {};

Accepted Solutions (0)

Answers (2)

Answers (2)

ravinsi4
Explorer
0 Likes

Hi Walid,

Were you able to resolve this issue? I am also facing a similar issue. Could you please share some details.

Thanks

Ravindra

Former Member
0 Likes

I tried to put the backend URI instead of webSocketURI variable like the code below but I get also the same error.

socket = new WebSocket("wss://ldciofd.mo.sap.corp:44378/sap/bc/apc/sap/zapc_test");