Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Folks,
I'm working with the C# QlikSense SDK along with a Nov2019 Patch 3 QlikSense system. When I connect, and ask for the cookie, I get {"Object reference not set to an instance of an object."}. Below is the code that throws the error:
ILocation location = Qlik.Engine.Location.FromUri(uri);
location.AsNtlmUserViaProxy(proxyUsesSsl:uri.Scheme.Equals(Uri.UriSchemeHttps,
loginCredentials: new NetworkCredential(username,passwordSecureString,domain),
certificateValidation: false);
//Throws error below.
var cookie = location.SessionCookie;
However, if I connect and then do somethings with my location, I can then request the cookie with no problems.
location.AsNtlmUserViaProxy(proxyUsesSsl:uri.Scheme.Equals(Uri.UriSchemeHttps),
loginCredentials: new NetworkCredential(username,passwordSecureString,domain),
certificateValidation: false);
using (new DebugConsole())
{
var appIdentitifers = location.GetAppIdentifiers();
var tractorHours2 = appIdentitifers.First(...
var app = location.App(...);
ISheetList sheetList = app.GetSheetList();
foreach(ISheetObjectViewListContainer item in sheetList.Items)
{
//Below works
var cookie = location.SessionCookie;
Is there anything I should be doing or know about concerning about when my cookie becomes available?
Any help is greatly appreciated.
The cookie is provided as part of the response headers when the websocket connection is established. So it is expected that the cookie will only be set after you perform a connection.
That said, triggering a null pointer exception is probably not the most users friendly way to handle that situation though...
The cookie is provided as part of the response headers when the websocket connection is established. So it is expected that the cookie will only be set after you perform a connection.
That said, triggering a null pointer exception is probably not the most users friendly way to handle that situation though...