Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am not able to locate qlik sense server using Dot Net SDK.
error message is:
Connection failed after 4 attempts. Unable to keep connection open: Failed to ensure open connection: GeneralCommunicationException with communication error WebSocketSendOnClosed and http error code 500.
I have already added my IP-Address in web socket whitelist in virtual proxy.
this is my code sample
try
{
Uri uri = new Uri("http://ServerIP:873");
ILocation location = Qlik.Engine.Location.FromUri(uri);
location.VirtualProxyPath = "virproxy";
location.AsStaticHeaderUserViaProxy("User ID", null, false);
using (IHub hub = location.Hub())
{
label1.Text = hub.ProductVersion();
}
}
catch (Qlik.Engine.Communication.CommunicationErrorException communicationException)
{
throw communicationException;
}
Hi! I see you use "null" for the argument "headerAuthenticationHeaderName" in your call to "AsStaticHeaderUserViaProxy". Can you try to set explicitly set it to the corresponding value for your virtual proxy? You'll find the name in the "Authentication" section for the virtual proxy settings in the QMC.
Thanks for reply.
Sorry I did not get your point, what value should pass to second argument in AsStaticHeaderUserViaProxy() function.
this is my proxy setting. Please help
Ah, it looks like that virtual proxy does not use static header authentication but authentication method "Ticket". Perhaps you should connect using NTLM authentication?
Try this method: location.AsNtlmUserViaProxy(false);
I have tried the same, In that case other error occurred.
Error Detail:
Connection failed after 4 attempts. Unable to keep connection open: Failed to ensure open connection: One or more errors occurred.
Updated Code:
Uri uri = new Uri("http://ServerIP:873");
ILocation location = Qlik.Engine.Location.FromUri(uri);
location.VirtualProxyPath = "virproxy";
location.AsNtlmUserViaProxy(false);
using (IHub hub = location.Hub()) //error occurred here.
{
label1.Text = hub.ProductVersion();
}
OK, here are three other suggestions for you:
1) Check that you are connecting to the right port.
2) Check that your proxy allows http-connections.
3) Check that your QMC is aware of your user.
Instructions for the three steps follows here:
1) Check that you are connecting to the right port.
In the QMC, check you port settings by following these steps:
- Select "Proxies" in the "CONFIGURE SYSTEM" section of the start page.
- Select the "Central" proxy and click the button "Edit".
- Check the "Ports" section under "Properties".
The port in your connection URI needs to match service listen port relevant for the protocol you are using when connecting. If you use "https", the port must match the port listed in "Service list port HTTPS". If you use "http", the port must match the port listed in "Service listen port HTTP".
Default settings are "443" for "https", and "80" for "http". If you do not add a port to your URI, then these ports will be assumed.
2) Check that your proxy allows http-connections.
In the QMC, check you http configuration settings by following these steps:
- Select "Proxies" in the "CONFIGURE SYSTEM" section of the start page.
- Select the "Central" proxy and click the button "Edit".
- Check the "Ports" section under "Properties".
Is the "Allow HTTP" check box checked? If it is not, then you will have to use "https" when connecting to the server.
3) Check that your QMC is aware of your user.
In the QMC, check your user configuration by following these steps:
- Select "Users" in the "MANAGE CONTENT" section of the start page.
- In the column "User ID", click the filter icon, and type your login user name.
Check that your user is there and that the "User directory" of the user matches the user domain of your login account. If your user is not there, or the "User directory" does not match, then you will not be able to login using NTLM. If your Qlik Sense server should contain your user, then you should check that your "User directory connectors" are configured correctly.
I have tried all the three steps i.e
But still the same issue.
Have you tried to connect using https?
Yes I have tried with https also, but getting same error.
Even I have created new virtual proxy.
I attaching New virtual directory setting and code sample screen shot.
Your screen shot for the virtual proxy seems to be the other virtual proxy you had (the one with the prefix "VirProxy"). Can you add one for the new one?