Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Not applicable

Use QlikSense API on a machine which is not QlikSense server

Hi all,

I'm building a web application and I'm trying to use QlikSense API which installed on a different machine.

The "require.js" file is on a remote server (QlikSense server)

My code is:

var config = {

    host: "[qlikSenseserverIP]",

    prefix: "/",

    port: 443,

    isSecure: true

};

  1. require.config({

    baseUrl: (config.isSecure ? "https://" : "http://") + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources"

});

require(["js/qlik"], function (qlik) {

          qlik.setOnError(function (error) {

$('#popupText').append(error.message + "<br>");

$('#popup').fadeIn(1000);

          });

          $("#closePopup").click(function () {

$('#popup').hide();

          });

          var app = qlik.openApp('[appID]', config);

});

I get this error after qlik.openApp('[appID]', config):

"WebSocket connection to 'ws://[qlikSenseserverIP]:443/app/[appID]?reloadUri=http%3A%2F%2Flocalhost%3A2000%2F[myDefaultPage]r%2FReports%2F%3FmenuType%3D1%26menuDes%3DBalance%2520Sheet' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET".

What may be the cause?

9 Replies
lathakatti
New Contributor II

Re: Use QlikSense API on a machine which is not QlikSense server

Hi,

Could you solve this issue?? I am facing the same issue.

Employee
Employee

Re: Use QlikSense API on a machine which is not QlikSense server

I'm considering you replace the qlikSenseserverIP with the actual IP address. If so seems there is something in between your server and QlikSense which cut the the web socket protocol

s29124141
Contributor II

Re: Use QlikSense API on a machine which is not QlikSense server

Make sure that you have whitelisted web server host and the ip address in your virtual proxy to allow web socket connections. Looking at the error message it looks like you are testing on localhost, hence add "localhost" as well to your virtual proxy white list.

lathakatti
New Contributor II

Re: Use QlikSense API on a machine which is not QlikSense server

If I whitelist the webserver host IP address, will I be able to access the web application from other machine. Because I got a Insecure response error in qlik.js when I tried opening the hosted web application in a different machine. In my local machine it worked.

Thanks.

jelle_vervloess1
New Contributor III

Re: Use QlikSense API on a machine which is not QlikSense server

i was strugling with this error asswel (i think), make sure you clear your cache from time to time since the connection could still be saved

s29124141
Contributor II

Re: Use QlikSense API on a machine which is not QlikSense server

If its a CORS issue, add access control allow origin to response headers. If not  post the error message and the screenshot.

lathakatti
New Contributor II

Re: Use QlikSense API on a machine which is not QlikSense server

No I get a error in console like "ERR_INSECURE_RESPONSE" while loading qlik.js

s29124141
Contributor II

Re: Use QlikSense API on a machine which is not QlikSense server

Check what authentication you have in place. Try the same by allowing anonymous authentication. If that solves then you are missing qlik session cookie in your requests.

oknotsen
Honored Contributor III

Re: Use QlikSense API on a machine which is not QlikSense server

Could you explain that a bit more?

What should I be looking for in my script / what is missing where?

May you live in interesting times!
Community Browser