13 Replies Latest reply: Aug 9, 2016 8:50 AM by René Engler RSS

    .NetSdk - Connection failed after 4 attempts

    René Engler

      Hi Guys,

       

      we use .NetSDK to integrate QlikSense in an ERP - system. Now we are faced with following problem:

           We are not able to cache the Location or the Connection, so we have to connect us with the QlikSense Server several times. But      after these attempts an error occurs:

      Exception NAVdiscovery.png

      It also affects the hub. The user has no access.

      2015-09-22 10_09_53-Qlik Sense.png

      Do you have a solution for this issue?

      (I reconstructed this with the engine API, but there is a similar problem. After several method calls I receive an errormessage, which includes the information, that the server has canceled the connection)

       

      Thank you

      René

        • Re: .NetSdk - Connection failed after 4 attempts
          Randy Holder

          I too have run into this issue. Everything was working fine until upgrading to Qlik Sense 2.1.1

          • Re: .NetSdk - Connection failed after 4 attempts
            Alexander Karlsson

            Hey,

             

            Are you opening additional apps?
            Each license is limited to 5 concurrent sessions so make sure you tidy up and close your sessions as you switch between apps.

            • Re: .NetSdk - Connection failed after 4 attempts
              Lars-Goran Book

              Hi,
              Lots of questions and confusions here, I will try sort this out.
              There are three types of sessions :
              Engine Session
              Proxy Session
              QlikConnection Session (.Net SDK)

              The engine session is built up of user id and session id, you can use the .Net SDKs Session.WithApp(IAppIdentifier appIdentifier,

              SessionType sessionType) to control the connect to the engine session. SessionType.Default is the same session as the clients session.
              You can also create you own session ids or use the SessionType.Random.

              The proxy session which is the connection to Qlik Sense instance (and affects the license user/token) and corresponds to a .Net SDK

              Location. Your Location will tipically be created with "Location.FromUri". The location can be reused for many apps.
              When the Location goes out of scope it will be disposed within the SDK but the liceense token will stil remain active for 30 minutes (this can be modified in the qmc).
              If you wish to drop he license before 30 minutes you must do a Logout (REST call) to the proxy to drop that license token, more information

              can be found in the Qlik Sense Proxy Service API under the help pages.

               

              Best practice is to create one Qlik.Engine.Location and reuse this between different Qlik Sense applications. If you need more than one create as many as you need, but be aware of licenses.

              Example:
              try
              {
                using (ILocation local = Qlik.Engine.Location.FromUri(new Uri("https://myserver.domain.com")))
                {
                  local.AsNtlmUserViaProxy();

                  foreach (var entry in local.GetAppIdentifiers())
                  {
                    try
                    {
                      using (var app = local.App(entry))
                      {
                        var reloadSucceded = app.DoReload();
                 // do other work
                      } // the engine session and .Net SDKs Session are disposed.
                    }
                    catch (Qlik.Engine.MethodInvocationException methodInvocationException)
                    {
                      // handle error
                    }
                  }
                } // using local, the license token will be released after 30 min.
              }
              catch (Qlik.Engine.Communication.CommunicationErrorException communicationException)
              {
                // handle error
              }

               

               

              Best regard

              Lars-Göran Book