Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Insider: Product Roadmap Edition on Feb 26, 1 PM ET: REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
UmeshC
Contributor
Contributor

Using .NET SDK (C#) to connect to QlikSense using a web proxy server

I have used QlikEngine JSON API and exploring how to achieve similar results with the .NET SDK. I have a few questions based on the code snippet below:

 

Uri uri = new Uri("wss://my_remote_host/jwt/app?transient="); 
//virtual proxy
            
AppIdentifier appId = new AppIdentifier();
appId.AppId = "<SOME APPID>";
appId.AppName = "<SOME APP NAME>";
var senseLocation = Location.FromUri(uri);

senseLocation.AsJwtViaProxy(Guid.NewGuid().ToString(), false); 
//hope I can pass a GUID for key
var bearerToken = GetToken(); 
//getting a bearer token to pass in the header
senseLocation.CustomUserHeaders.Add("Authorization", "bearer " + bearerToken); //passing authorization header

var senseSession = Session.WithApp(appId, SessionType.Default);
QlikConnection conn = new QlikConnection(senseLocation, senseSession);
IEnumerable<string> argNames = new List<string>(); //WHAT ARGS?
string[] arguments = null; //WHAT PARAMS?
var response = await conn.SendAsync(1, "GetDocList", argNames, arguments);

 

 

  1. Hope I can pass a unique value like a GUID string for the JWTProxy object (in senseLocation.AsJwtViaProxy(Guid.NewGuid().ToString(), false))
  2. Can the URL be same as the wss:// URL used for websocket JSON API?

  3. My connection requires a HTTP proxy as well. Where do I specify the same? (I have tested this is working for websocket JSON API). 

  4. How do I make the JSON payload and pass it as arguments to SendAsync method? The method requires a List<string> and a string[]. Need to know where/how to pass the JSON payload for the GetDocList server method. In the websocket JSON API, I would normally pass the JSON
    like {"jsonrpc":"2.0","id":0"handle":-1,"method":"GetDocList","params":[]}

  5. I tried below code to iterate over document list using the Hub but connection fails here as well.

 

            using (IHub hub = senseLocation.Hub()) 
            //SocketException: No such host is known
            {
                var apps = hub.GetAppList();
                foreach (var app in apps)
                {
                    Console.WriteLine(app.AppId + ": " + app.AppName);
                }
            }

 

Thanks a ton in advance.

Labels (2)
10 Replies
tts
Employee
Employee

Qlik Sense .NET SDK v15.6.1 was released 10 days ago.
https://www.nuget.org/packages/QlikSense.NetSDK/15.6.1
but, Release Notes(ChangeLog) page has not been updated yet.
https://help.qlik.com/en-US/sense-developer/November2021/Subsystems/NetSDKAPIref/Content/ReleaseNote...

Please update online help site asap.