Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Highlighted
agni_gold
Valued Contributor II

Connect Qliksense Desktop engine

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>
1 Solution

Accepted Solutions

Re: Connect Qliksense Desktop engine

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

3 Replies

Re: Connect Qliksense Desktop engine

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

agni_gold
Valued Contributor II

Re: Connect Qliksense Desktop engine

so it means there is no way to connect qliksense desktop engine without opening qliksense desktop ?

Re: Connect Qliksense Desktop engine

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

Community Browser