<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Error during WebSocket handshake: Unexpected response code: 403 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/error-during-websocket-handshake-unexpected-response-code-403/qaa-p/12218843#M4573284</link>
    <description>&lt;P&gt;I tried to put the backend URI instead of webSocketURI variable like the code below but I get also the same error.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;socket = new WebSocket("wss://ldciofd.mo.sap.corp:44378/sap/bc/apc/sap/zapc_test");
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 18 Jul 2020 07:51:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2020-07-18T07:51:07Z</dc:date>
    <item>
      <title>Error during WebSocket handshake: Unexpected response code: 403</title>
      <link>https://community.sap.com/t5/technology-q-a/error-during-websocket-handshake-unexpected-response-code-403/qaq-p/12218842</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
  &lt;P&gt;I want to implement a notification system in my SAPUI5 application developed with SAP Web IDE.&lt;/P&gt;
  &lt;P&gt;So I followed the steps described in these blogs &lt;A href="https://blogs.sap.com/?p=89675"&gt;ABAP Channels Part 1&lt;/A&gt; , &lt;A href="https://blogs.sap.com/?p=104587"&gt;ABAP Channels Part 2&lt;/A&gt; , &lt;A href="https://blogs.sap.com/?p=105614"&gt;ABAP Channels Part 3&lt;/A&gt;, and I also tried this blog &lt;A href="https://sapyard.com/push-notification-in-sap-abap-push-channel-abap-messaging-channel-in-sapui5-a-real-time-interaction/"&gt;Real time push notification in SAP ABAP&lt;/A&gt;.&lt;/P&gt;
  &lt;P&gt;But I get this error message while connecting to APC with websocket : &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;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&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;Can anyone help me please.&lt;/P&gt;
  &lt;P&gt;This is my JS code&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;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() {};
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jul 2020 15:46:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-during-websocket-handshake-unexpected-response-code-403/qaq-p/12218842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-07-14T15:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error during WebSocket handshake: Unexpected response code: 403</title>
      <link>https://community.sap.com/t5/technology-q-a/error-during-websocket-handshake-unexpected-response-code-403/qaa-p/12218843#M4573284</link>
      <description>&lt;P&gt;I tried to put the backend URI instead of webSocketURI variable like the code below but I get also the same error.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;socket = new WebSocket("wss://ldciofd.mo.sap.corp:44378/sap/bc/apc/sap/zapc_test");
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Jul 2020 07:51:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-during-websocket-handshake-unexpected-response-code-403/qaa-p/12218843#M4573284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-07-18T07:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error during WebSocket handshake: Unexpected response code: 403</title>
      <link>https://community.sap.com/t5/technology-q-a/error-during-websocket-handshake-unexpected-response-code-403/qaa-p/12218844#M4573285</link>
      <description>&lt;P&gt;Hi Walid,&lt;/P&gt;&lt;P&gt;Were you able to resolve this issue? I am also facing a similar issue. Could you please share  some details. &lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Ravindra &lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 11:43:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-during-websocket-handshake-unexpected-response-code-403/qaa-p/12218844#M4573285</guid>
      <dc:creator>ravinsi4</dc:creator>
      <dc:date>2021-05-07T11:43:20Z</dc:date>
    </item>
  </channel>
</rss>

