Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

stvegerton
Contributor 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
New Contributor II

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

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
Contributor III

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

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
Contributor III

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

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
New Contributor II

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

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
New Contributor II

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

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
Contributor III

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

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
New Contributor II

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

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
Contributor III

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

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).

Community Browser