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: 
Not applicable

Unable to connect to QlikSense server through .NET SDK

Hi,

I tried several ways of connecting to the qliksense server but in vain. When I go to the link, I have to login through my user name and password.

I tried -

ILocation location = Qlik.Engine.Location.FromUri(new Uri("https://abc.com")); //name changed
location.AsNtlmUserViaProxy();

I also tried -

ILocation location = Qlik.Engine.Location.FromUri(new Uri("https://abc.com:4747")); //name changed

location.AsNtlmUserViaProxy();

and

ILocation location = Qlik.Engine.Location.FromUri(new Uri("https://abc.com"));

location.AsStaticHeaderUserViaProxy("userid");

My virtual proxy has authentication method as ticket and Windows authentication pattern as Windows.

I have added the link in the Websocket origin white list and I have tried several ways listed in the qlik sense .NET SDK website.

What can I be doing wrong? I get an error message saying

An unhandled exception of type 'Qlik.Engine.Communication.CommunicationErrorException' occurred in Qlik.Engine.dll

Additional information: Connection failed after 4 attempts. Unable to keep connection open: Failed to ensure open connection: One or more errors occurred.


Appreciate all the help I can get!

1 Solution

Accepted Solutions
Not applicable
Author

Ah I found the solution, I enabled http in proxies and then wrote -

ILocation location = Qlik.Engine.Location.FromUri(new Uri("http://abc.com"));

            location.AsNtlmUserViaProxy(proxyUsesSsl: false);

View solution in original post

6 Replies
Not applicable
Author

I am basically trying to call my qvf file (which reloads my app by taking in parameters) in .NET and then I can execute this .NET program through command line by calling it in my SSIS package.

Not applicable
Author

Ah I found the solution, I enabled http in proxies and then wrote -

ILocation location = Qlik.Engine.Location.FromUri(new Uri("http://abc.com"));

            location.AsNtlmUserViaProxy(proxyUsesSsl: false);

rajeshvaswani77
Specialist III
Specialist III

Hi Meghana,

Are you able to connect now? Whats the final code you arrived at?

I still have issues connecting, in-spite of white-listing the client.

The error i get is



An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll

Have you come across?

Thanks,

Rajesh Vaswani

Anonymous
Not applicable
Author

Hi Meghana,

  I am trying to connect Qlik Sense server through dotnet sdk and getting below mentioned error:-

Qlik.Sense.JsonRpc.CommunicationErrorException: Connection failed after 4 attempts. Error message:

Value cannot be null.


I tried :-

  location.AsNtlmUserViaProxy(proxyUsesSsl: uri.Scheme.Equals(Uri.UriSchemeHttps), loginCredentials: new NetworkCredential(username, password, domain));

 

Could you please share your code.

thanks,

Nayana

vishva2000
Contributor II
Contributor II

I am not well experienced .Net developer(neither C#). However I was able to connect to the server using some of the code provided in https://github.com/AptkQlik/PublicExamples

I used the method in ConnectDirectRemoteServer . However I guess if the SSl is enabled there may be an issue with code. I had to set  certificateValidation: false to the AsDirectConnection method

i.e.

         location.AsDirectConnection("domain", "user", certificateCollection: certificateCollection);

  to

location.AsDirectConnection(“user directory name", "user_id", certificateValidation: false, certificateCollection: certificateCollection);

This code to be worked, need to export certificate into the remote server where you run this code.

Also worth checking the following been setup (I did not want to set allow http in QMC or Windows authentication patterns to windows as it mentioned, but had to allow firewall to accept 4747 port and allow request from my ip to the server)

http://help.qlik.com/en-US/sense-developer/June2017/Subsystems/NetSDKAPI/Content/CodeExamples/Troubl...

agigliotti
Partner - Champion
Partner - Champion

Hi,

I'm facing the same issue.

Did you find any solution ?

Please let me know.

Many thanks.

Best Regards

Andrea