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: 
stvegerton
Creator III
Creator III

engine at https://myserver.mycompany.corp is not alive when trying to connect

Just starting to use the Qlik Sense .net SDK in visual studio and I'm getting this error. I've already checked the default virtual proxy to make sure my full computer name is on the white list. But it doesn't seem to make a difference. Any advice?

Thanks, Steve

using System;

using Qlik.Engine;

 

namespace AppTraverser

 

   internal static class AppTravers

   private static void Main(string[] args)

 

   var location = GetQlikDesktopLocation();

   

   Console.ReadLine();

  

   private static ILocation GetQlikDesktopLocation()

 

   //Defines the location for Qlik Desktop on localhost.

   //var location = Location.FromUri(new Uri("ws://127.0.0.1:4848"));

   var location = Location.FromUri(new Uri("https://myserver.mycompany.corp"));

  location.AsDirectConnectionToPersonalEdition();

   return location;

8 Replies
jbj
Employee
Employee

You need define how you want to connect to Qlik Sense, you can find examples on how do do different type of connections on GitHub (GitHub - AptkQlik/PublicExamples‌) see the examples starting with "Connect..."

If you're using NTML you just need to add this to your example:

location.AsNtlmUserViaProxy(proxyUsesSsl: true);

stvegerton
Creator III
Creator III
Author

Thanks Johan, we use AD so I'm guessing I wouldn't need NTLM. I'm connecting to a remote server within my domain so I'll try to use ConnectDirectRemoteServer. Please let me know if you think I'm going down the wrong road. Thanks, Steve

stvegerton
Creator III
Creator III
Author

Think I'm getting warm.

Not 100% sure of what to put into "PathToMyCertFile.pfx". Do I just generate another cert like I did back when I added nodes?

   //var uri = new Uri("https://myQlikSenseServer.myDomain.com");

   var uri = new Uri("https://mycompany.mydomain.corp");

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

   X509Certificate2 x509 = new X509Certificate2();

   //Create X509Certificate2 object from .cert file.

   byte[] rawData = ReadFile("PathToMyCertFile.pfx");

  x509.Import(rawData, "PasswordToMyCert", X509KeyStorageFlags.UserKeySet);

   X509Certificate2Collection certificateCollection = new X509Certificate2Collection(x509);

   // Defining the location as a direct connection to Qlik Sense Server

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

jbj
Employee
Employee

It depends on your use case. A direct connection connects the SDK directly to a specific Qlik Sense Engine, this would for instance be useful if you build a service where you don't want to go through the proxy and always want to run as a specific user.


If you for instance build an application where you want the logged in user to authenticate against Qlik Sense you should use NTLM.

jbj
Employee
Employee

Yes you need to generate it from the QMC as you do when you add nodes, you need to generate a certificate for the machine(s) that will be running the .NET SDK.

stvegerton
Creator III
Creator III
Author

My use case: I'm trying to use the app preload public code example from my PC/visual studio connecting to one of my Qlik Sense engine servers. Eventually, I was thinking it would compile it as an .exe and run it on a schedule in the engine server using my qlik sense service account on the server.

Does this sound like a normal approach?

jbj
Employee
Employee

Yes sounds like a normal approach

If you're running the .NET SDK on the same machine as Qlik Sense you can look at the ConnectDirectLocalServer example.

stvegerton
Creator III
Creator III
Author

Thanks! NTLM connection worked. So then I combined it with the AppPreload project into one solution and ran debug which seems to be churning. But when I check task manager on the servers, I don't see any connections. Debug just keeps adding lines like this below. Oh well, back to it tomorrow.

The thread 0x1bec has exited with code 259 (0x103).

The thread 0x2160 has exited with code 259 (0x103).

The thread 0x14e8 has exited with code 259 (0x103).

The thread 0x1e78 has exited with code 259 (0x103).

The thread 0x127c has exited with code 259 (0x103).

The thread 0x2788 has exited with code 259 (0x103).

The thread 0x21fc has exited with code 259 (0x103).

The thread 0x1ea8 has exited with code 0 (0x0).

The thread 0x22b0 has exited with code 0 (0x0).

The thread 0x1bd4 has exited with code 259 (0x103).