Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

How to fix this Error : An exception of type 'Qlik.Engine.Communication.CommunicationErrorException' occurred in Qlik.Engine.dll but was not handled in user code Additional information: Connection failed after 4 attempts.

Hello ,

         I am trying to connect with QlikSense through .Net SDK , My qliksense server is hosted in my dedicated server , i am able to access from my browser . When i connect them from the .Net SDK code , it throws the following error :

Connection failed after 4 attempts. Error message:
  The handshake failed due to an unexpected packet format.


I would like to paste my code for your view :


       ILocation location = Qlik.Engine.Location.FromUri(new Uri("http://myserveripSmiley Tongueort/"));

        location.AsDirectConnectionToPersonalEdition();

        using (IHub hub = location.Hub())

        {

            string value = hub.ProductVersion();

        }

can you please help to fix this issue .

Thanks for your support.

3 Replies
Employee
Employee

Re: How to fix this Error : An exception of type 'Qlik.Engine.Communication.CommunicationErrorException' occurred in Qlik.Engine.dll but was not handled in user code Additional information: Connection failed after 4 attempts.

AsDirectConnectionToPersonalEdition indicates you are connecting to a Qlik Sense Desktop instance and not a Server.

You probably wanna connect using the NTML methods instead if you want to authenticate against the Server

Not applicable

Re: How to fix this Error : An exception of type 'Qlik.Engine.Communication.CommunicationErrorException' occurred in Qlik.Engine.dll but was not handled in user code  Additional information: Connection failed after 4 attempts.

Thanks Alex ,

         I have constructed the code as per your suggestion , please find the code below :

          var uri = new Uri("https://myQlikSenseServer.myDomain.comSmiley Tongueort");

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

          location.AsNtlmUserViaProxy(proxyUsesSsl:true);

          The same error occurs again.

        I have some clarifications in my mind , i would like to bring to your notice . they are :

       1. Is it possible authenticate qliksense server using the code itself , i don't want the page to ask the Username and Password ?, and where to hard code the Credentials ?

       2. do i need to give any permissions to give access to my server , in order to connect from the .Net SDK code ?

       3. i have download the sample application given by the Community (PublicExamples) , using this code , i am trying to connect my server , the same error occurs again and again .

Please give me a solutions for this problems .

Thanks .

jbj
New Contributor II

Re: How to fix this Error : An exception of type 'Qlik.Engine.Communication.CommunicationErrorException' occurred in Qlik.Engine.dll but was not handled in user code  Additional information: Connection failed after 4 attempts.

Do you have a valid certificate for the proxy you're connecting to?

If not you can test to override certificate validation using:

location.AsNtlmUserViaProxy(certificateValidation:false);

Community Browser