Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dec 16, 2022 2:19:55 AM
Jun 3, 2017 5:42:34 AM
This article explains how to get started with the .NET SDK
The following must be installed to test the example provided in this article:
*It does not need to be installed on the same machine, but proper ports must be open for incoming connection on the Qlik Sense server side.
Please also make sure that the user connecting from the .NET SDK has a license assigned
Environments:
In the below program, we are using Windows authentication, so we have to use the AsNtlmUserViaProxy function to specify that we want to use Windows authentication.
// using System, etc. using Qlik; using Qlik.Engine; namespace ConsoleApp1 { class Program { static void Main(string[] args) { Uri uri = new Uri("https://qlikserver3.domain.local/"); ILocation location = Qlik.Engine.Location.FromUri(uri); location.AsNtlmUserViaProxy(certificateValidation: false); using (var hub = location.Hub()) { Console.WriteLine("Product Version: " + hub.ProductVersion()); Console.WriteLine("OS Name: " + hub.OSName()); Console.WriteLine("OS Version: " + hub.OSVersion()); Console.WriteLine("Press enter to close..."); Console.ReadLine(); } } } }
Product Version: 3.2.3
OS Name: WindowsNT
OS Version: 6.2.9200
Press enter to close...
Connect to an app:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Qlik; using Qlik.Engine; namespace ConsoleApp1 { class Program { static void Main(string[] args) { Uri uri = new Uri("https://qlikserver1.domain.local/"); ILocation location = Qlik.Engine.Location.FromUri(uri); location.AsNtlmUserViaProxy(certificateValidation: false); IAppIdentifier appIdentifier = location.AppWithId("03bbedf2-2c45-4e10-bf5a-fded0c21cda8"); using (var app = location.App(appIdentifier)) { var layout = app.GetAppLayout(); Console.WriteLine(layout.Title + " [" + app.Type + "]"); Console.ReadLine(); } } } }
Result:
Test1 [Doc]
Tip: If the program does not run, try to build it and execute the .exe file from the Qlik Sense server. If that works locally from the server itself, it might be that there is a network device that is not allowing the connection or the proper ports are not open.