Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Qlik Sense .Net SDK: Error connecting to Sense Server

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 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

1 Solution

Accepted Solutions
Highlighted
Employee
Employee

Have you added your domain to the websocket origin white list? If not, then you need to do that in the virtual proxy settings in the QMC, You'll find the setting under the "Properties" section called "Advanced" in the "Virtual proxy edit" form you added a screen shot from.

More information about connecting to the server can be found at this page:

Connecting to Qlik Sense .NET SDK step-by-step ‒ Qlik Sense

Best regards, Øystein Kolsrud

View solution in original post

3 Replies
Highlighted
Partner
Partner

Hi Fabio,

I am having the same problem here. Any Qlik resource to provide some sample code for authentication? mto‌, would you please point us in the right direction?

Thank you.

Hugo Andrade.

Highlighted
Employee
Employee

Have you added your domain to the websocket origin white list? If not, then you need to do that in the virtual proxy settings in the QMC, You'll find the setting under the "Properties" section called "Advanced" in the "Virtual proxy edit" form you added a screen shot from.

More information about connecting to the server can be found at this page:

Connecting to Qlik Sense .NET SDK step-by-step ‒ Qlik Sense

Best regards, Øystein Kolsrud

View solution in original post

Highlighted
Partner
Partner

Thank you! Just by adding my domain to white list on the new created proxy solved. However, having it on the Central proxy shouldn't be enough? Anyways, thanks again!!!