Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
I trying to connect my qliksense desktop engine through api , attached my code as well , now when i run this code , i am getting below error in console :
WebSocket connection to 'ws://localhost:4848/app/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
While when i open my qliksense desktop and login with my qlik community credential and then refreshing my browser , it is running and getting corrrect output.
Please let me know what wrong is here.
Code :
<html>
<body>
<ul id='docList'>
</ul>
</body>
</html>
<script>
var ws = new WebSocket("ws://localhost:4848/app/");
//var ws = new WebSocket("wss://qst.syngenta.com:4747/app/");
var request = {
"handle": -1,
"method": "GetDocList",
"params": {},
"outKey": -1,
"id": 1
}
ws.onopen = function(event){
ws.send(JSON.stringify(request));
// Receive the response
ws.onmessage = function (event) {
var response = JSON.parse(event.data);
if(response.method != ' OnConnected'){
var docList = response.result.qDocList;
var list = '';
docList.forEach(function(doc){
list += '<li>'+doc.qDocName+'</li>';
})
document.getElementById('docList').innerHTML = list;
}
}
}
</script>
Yes. Your javascript program is a client that wants to connect to a server. That server has to be running to accept a connection. The server could be QS Desktop, QS Enterprise or Qlik Core. No matter the server, it has to be running to accept a connection.
-Rob
Your Qlik Sense Desktop must be opened and logged in for websocket connection to work. Without this step, there is no localhost:4848 available to connect to.
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Yes. Your javascript program is a client that wants to connect to a server. That server has to be running to accept a connection. The server could be QS Desktop, QS Enterprise or Qlik Core. No matter the server, it has to be running to accept a connection.
-Rob