Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
agni_gold
Specialist III
Specialist III

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
rwunderlich
MVP
MVP

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

View solution in original post

3 Replies
rwunderlich
MVP
MVP

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
Specialist III
Specialist III
Author

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

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