Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I'm trying to use the .NET SDK to connect to a QlikSense server (febbruary 2018 version) using a certificate.
I exported the certificate from the QMC (including private key) and then I try to use this code:
Uri uri = new Uri("https://mysenseserver.local");
var senseLocation = Qlik.Engine.Location.FromUri(uri);
//Load certificate
X509Certificate2 x509 = new X509Certificate2(@"C:\client.pfx", "cert_password", X509KeyStorageFlags.UserKeySet);
X509Certificate2Collection x509coll = new X509Certificate2Collection(x509);
//Connect to QlikSense server
senseLocation.AsDirectConnection(
"myuserdir", //User directory
"administrator", //UserID (this user is RootAdmin)
false,
false,
x509coll //Certificate
);
//Connect to app
var appIdentifiers = senseLocation.GetAppIdentifiers(); //This causes exception...
this causes the following exception:
GeneralCommunicationException with communication error WebSocketClosed and http error code 500
at Qlik.Engine.Communication.QlikConnection.AwaitResponseTask
(T task, String methodName, CancellationToken cancellationToken) at Qlik.Engine.Communication.QlikConnection.Ping(Nullable`1 noVersionCheck)
at Qlik.Engine.LocationExtensions.Hub(ILocation location, ISession session, Nullable`1 noVersionCheck)
at Qlik.Engine.LocationExtensions.GetAppIdentifiers(ILocation location, Nullable`1 noVersionCheck)
at QlikExporter.Core.Logic.SenseAgent.ConnectToApp()
can anyone tell me what I'm doing wrong?
If you do a direct connection, then you should typically add the Engine port number to the Uri. Default value for this is 4747 for a Server installation of Qlik Sense (4848 for desktop). Check out this example:
If you do a direct connection, then you should typically add the Engine port number to the Uri. Default value for this is 4747 for a Server installation of Qlik Sense (4848 for desktop). Check out this example:
Thanks, that was the issue! Port 4747 is working correctly.