Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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
Partner Ambassador/MVP
Partner Ambassador/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
Partner Ambassador/MVP
Partner Ambassador/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
Partner Ambassador/MVP
Partner Ambassador/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