Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vpraja03
Contributor
Contributor

Not able to connect to QlikSense using C# code

Hi,

I am using the below code to connect to QlikSense via C#

string url = "https://abc.test.com";

Uri uri = new Uri(url);

ILocation location = Qlik.Engine.Location.FromUri(new Uri(url));
location.AsNtlmUserViaProxy();

using (IHub hub = location.Hub())
{
     Console.WriteLine(hub.EngineVersion().ComponentVersion);
}

while debugging, the command comes to using (IHub hub = location.Hub()) line, getting the below error.

Kindly help me to resolve it asap.

Qlik.Sense.JsonRpc.CommunicationErrorException   HResult=0x80131500   Message=Connection failed after 4 attempts. Error message:   No connection could be made because the target machine actively refused it [::ffff:104.75.169.225]:443   Source=Qlik.Engine   StackTrace:    at Qlik.Engine.Communication.QlikConnection.AwaitResponseTask[T](T task, String methodName, CancellationToken cancellationToken)    at Qlik.Engine.Communication.QlikConnection.Ping(Nullable`1 noVersionCheck)    at Qlik.Engine.LocationExtensions.Hub(ILocation location, ISession session, Nullable`1 noVersionCheck)    at WindowsFormsApp1.Form1.Form1_Load(Object sender, EventArgs e) in C:\Users\Guest_qlik\source\repos\WindowsFormsApp1\WindowsFormsApp1\Form1.cs:line 46    at System.Windows.Forms.Form.OnLoad(EventArgs e)    at System.Windows.Forms.Form.OnCreateControl()    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)    at System.Windows.Forms.Control.CreateControl()    at System.Windows.Forms.Control.WmShowWindow(Message& m)    at System.Windows.Forms.Control.WndProc(Message& m)    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)    at System.Windows.Forms.Form.WmShowWindow(Message& m)    at System.Windows.Forms.Form.WndProc(Message& m)    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)  Inner Exception 1: AggregateException: One or more errors occurred.  Inner Exception 2: SocketException: No connection could be made because the target machine actively refused it

Labels (1)
0 Replies