Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Folks,
I'm using QlikSense November 2019 along with a C# project containg QlikSense.NetSDK v 14.1.0 and .NETFramework,Version=v4.7.2
When I run the following code, it throws an error:
Uri uri = new Uri("https://qliksense.somesite.net");
ILocation location = Qlik.Engine.Location.FromUri(uri);
//credential information
//...
///
location.AsNtlmUserViaProxy(proxyUsesSsl: uri.Scheme.Equals(Uri.UriSchemeHttps),
loginCredentials: new NetworkCredential(user, pwd, domain),
certificateValidation: false);
//Throws an error with the "location.Hub()" call
using (IHub hub = location.Hub())
{
Console.WriteLine(hub.EngineVersion());
}
The error that I get is from the location.Hub() call and it gives me the following message and stacktrace.
Message
Not a valid method
Parameter name: response
StackTrace
at Qlik.Engine.Communication.QlikConnection.AwaitResponseTask[T](T task, String methodName, CancellationToken cancellationToken)
at Qlik.Engine.Communication.QlikConnection.Ping()
at Qlik.Engine.LocationExtensions.Hub(ILocation location, ISession session)
at QlikTestOne.Program.Main(String[] args) in C:\Users\jdallas\source\repos\QlikTestOne\Program.cs:line 39
What could I be doing wrong? I was thinking that maybe I a port blocked or something, but when it says that it's not a valid method, I think that it has to do something with an API mismatch.
Any help is greatly appreciated.
Now that's an odd one... I think you should turn on the debug console and see what the websocket traffic looks like. Just add a using clause in front of the hub opening clause you already have, like this:
using (new DebugConsole())
using (IHub hub = location.Hub())
{
Console.WriteLine(hub.EngineVersion());
}
I honestly have no idea of what happened. I started my code today after leaving it alone since Monday, and it works!
The one thing I can think of is that the user/pass I'm using wasn't allocated a token until yesterday.
Funny thing... I ran into pretty much the exact same thing just a few days later. I think I had put the engine in some odd state at that point though. The problem disappeared by it self a short while later, and I didn't see it again.
I'm a heavy user of Qlik Sense .NET SDK and I was never able to solve this problem. It is intermittent and hard to predict where it is going to happen.
I suspect this error is triggered when the SDK receives a push method (like the "OnConnected" you get when establishing a connection) that it doesn't recognize. What type of authentication are you using? Is via Proxy or a direct connection to the engine using certificates?
@JustinDallas@marksouzacosta: The latest release of the .NET SDK (v15.3.1) contains some improved error messages in this domain. It should now at least report the identifier of the push method that was encountered instead of simply complaining about "Parameter name: response".
Thanks! I'll give it a gander and check it out when I have some free time. My little project could use a revision.
@JustinDallas @marksouzacosta Have any of you encountered this a connection error again after upgrading to version v15.3.4 or newer? With these versions, the SDK should throw an exception of the following type:
System.Exception: <method name> [<severity>]: <message>
It is in particular method name that I am curious about.
So far I'm good. Not having many errors since the last releases of the .NET SDK.
P.S: I'm actually having a hard time using the IHub.ExportApp Method but this is another subject - I work around this problem using the Qlik Sense Rest SDK + QRS.
Thank you,
Mark Costa