Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik Sense Server .NET Connection Issue

I am currently unable to connect to the Qlik Sense Server installation within my company's network.  I have used the example given within the Qlik Developer documentation as a guideline but it does not seem to be working.  Any help getting the simple section of code to work will be greatly appreciated.

I have tried using the AsNtlmUserViaProxy() but am not exactly sure how this specifically connects (active logged in windows user, credentials, etc.?), and returns the error message "Connection failed after 4 attempts. Unable to keep connection open: Failed to ensure open connection: One or more errors occurred."  I know there are other connection methods such as AsDirectConnection() but I cannot get them to work either.

Uri qlikURI = new Uri("https://qlikSenseServerURL");    // URL was changed for posting

ILocation location = Qlik.Engine.Location.FromUri(qlikURI);

// TODO: What is the code to setup active connection?

using (IHub hub = location.Hub())

{

// Interaction with HUB goes here

}

3 Replies
Not applicable
Author

Hi,

AsNtlmUserViaProxy will use the credentials (userid and domain) of the logged in user. AsDirectConnection is used when the application is on the server and must be configured with a certificate. Your issue is probalby ralated to the configuration. Check "Websocket origin white list" in your QMC (see Virtual proxies - Advanced), you can add your ip-adress or your domian (example qlik.com). It can also be an issue with your certificate, you can test to "Allow HTTP" (see Proxies - Ports).

Best Regards

Lars-Göran Book

Not applicable
Author

The white list already contains my domain and when I try an http request (with certificate) to get a ticket it successfully returns a ticket.

More info - now when I call AsNtlmUserViaProxy() and then call location.Hub() I see within fiddler that the html for the proxy redirect authorization page (buttons to Build Request Data and then Send Request based on the input fields on the screen) gets returned in whatever web request is happening behind the scenes.  It looks like location.Hub() is expects something different which is why a connection cannot be created.

Not applicable
Author

Hi,

The location.Hub uses the location that has been created. Are you using a virtual proxy?

Have you tested some of the samples? See Download code samples ‒ Qlik Sense

Attached are two examples should work.

Examples:

// qlik sense server with proxy,  https://mycomputer.domain.com/myproxy

var qlikServer = new Uri("https://mycomputer.domain.com")

var location = Location.FromUri(qlikServer);

location.VirtualProxyPath = GetVirtualProxy("myproxy");

bool ssl = connectString.Scheme.Equals("https");

location.AsNtlmUserViaProxyAsync(proxyUsesSsl: ssl);

var version = location.Hub(noVersionCheck:true).ProductVersion();

// qlik sense server no proxy,  https://mycomputer.domain.com

var qlikServer = new Uri("https://mycomputer.domain.com")

var location = Location.FromUri(qlikServer);

bool ssl = connectString.Scheme.Equals("https");

location.AsNtlmUserViaProxyAsync(proxyUsesSsl: ssl);

var version = location.Hub(noVersionCheck:true).ProductVersion();


Best Regards

Lars-Göran Book