3 Replies Latest reply: Feb 22, 2016 7:20 AM by Fabio Hora RSS

    Qlik Sense .Net SDK: Error connecting to Sense Server

    Fabio Hora

      Hi,

       

      I'm trying to access a Sense Server using .Net SDK and I'm having this error:

       

      Qlik.Engine.Communication.CommunicationErrorException: Connection failed after 4 attempts. Unable to keep connection open: Failed to ensure open connection: Um ou mais erros.  em Qlik.Engine.Communication.QlikConnection.AwaitResponseTask[T](T task, String methodName, CancellationToken cancellationToken)  em Qlik.Engine.Hub.QTProduct()  em Qlik.Engine.LocationExtensions.Hub(ILocation location, ISession session, Boolean noVersionCheck)  em QlikSENSEConsoleTest.Program.Main(String[] args) na C:\Users\fabio.hora\Documents\Visual Studio 2015\Projects\QlikSENSEConsoleTest\QlikSENSEConsoleTest\Program.cs:linha 27

       

      Below my code and Virtual proxy config:



      using System;

      using System.Collections.Generic;

      using System.Linq;

      using System.Text;

      using System.Threading.Tasks;

      using Qlik.Engine;

      using System.Security.Principal;

      using System.Runtime.InteropServices;

      using System.Net.Sockets;

       

       

      namespace QlikSENSEConsoleTest

      {

          class Program

          {

              static void Main(string[] args)

              {

                  try

                  {

       

       

                      Uri uri = new Uri("https://mysenseserver.com"); // name changed.

                      ILocation qsLocation = Qlik.Engine.Location.FromUri(uri); ;

                     

                      qsLocation.VirtualProxyPath = "API";

                      qsLocation.AsStaticHeaderUserViaProxy("fabio.hora", "sdk-api");

       

       

                     

                      IHub qsHub = qsLocation.Hub();

       

       

                      Console.WriteLine(qsHub.ProductVersion());

                      foreach (IAppIdentifier appIdentifier in qsLocation.GetAppIdentifiers())

                      {

                          Console.WriteLine(appIdentifier.AppName);

                      }

                      Console.WriteLine("\nPRESS \'ENTER\' TO EXIT");

                      Console.ReadLine();

                  }

                  catch (SocketException sex)

                  {

       

       

                      Console.WriteLine(sex);

                      Console.ReadLine();

       

       

                  }

                  catch (Exception ex)

                  {

       

       

                      Console.WriteLine(ex);

                      Console.ReadLine();

       

       

                  }

                  finally

                  {

       

       

                  }

              }

          } 

      }

       


      2016-02-17_19-54-47.jpg