Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Do you need to do some configuration in QMC or your local Windows settings to get your .NET Windowsforms to connect to Sense?
I have read the Betahelp for Sense API, but I cannot seem to get around the error, everything compiles fine but I keep geeting a Sockets.SocketException which says 'no connection could be made because target machine actively refused it 127.0.0.1:4848'
Turned off firewall and went through QMC but nothing, I did notice that the port for Engine in QMC is 4747, not 4848, but I guess that's the way it should be.
Any advice? Have anyone tried the .NET API for Sense and have a short and sweet code example to share
var localSenseEngine = Qlik.Engine.Location.Local;
var appIdentifier = localSenseEngine.AppWithName("myAppName.qvf");
using (IApp app = localSenseEngine.App(appIdentifier))
{
...
}
For more information see .Net SDK help
Hmm, no. not working.
My code looks like this
ILocation myLocation = Qlik.Engine.Location.Local;
using (IHub hub = myLocation.Hub())
{
MessageBoxShow(hub.QvVersion());
}
which results in SocketException "No connection could be made because the target machine actively refused it 127.0.0.1:4848"
I have tried running the Qlik Sense services with Local System, a specific Sense user with Admin rights, checked the firewalls etc... hmm, I cannot see what the problem is.
Hi Markus -
Some clarifications / questions:
We have seen this in a couple of situations (with Qlik Sense Desktop) when a proxy is being used - can you check your internet connection settings and see if you can bypass proxy for local address is checked?
Depending on the answers for the above questions - we have also seen where a previous releases' certificates may need to be removed.
When logging in to https://localhost/qmc - you can just ignore the certificate error and depending on the borwser you are using, just trust it and accept it - for now. You can also choose to enable http - once you get into the console in the proxy configuration.
Check out the above steps and let us know if this helps.
Mike Tarallo
I do not have Sense Desktop installed, only Sense Platform 1.0 GA.
I cannot connect http://localhost:4848/hub (but again, do not have Desktop installed, only https works for hub and QMC).
I have had no other previous installs, this is on fresh Windows with no Sense Beta software previously.
I will try removing the certificates.
Hi Markus - good - so now we know what we are dealing with.
What is odd, is that in your original post, you are getting a connection refused to a port that is not in use with the Qlik Sense platform system. (4848) So this makes me think there is a misconfiguration in your program somewhere. Possibly a hard-coded value somewhere?
I checked my server and this is what I found:
Here is my proxy configuration
Here are my listening ports: - using netstat -a -p tcp
As you can see I don't see port 4848
If you have a functioning Qlik Sense environment - I can only assume you followed these instructions:
I would suggest to follow from the start and make sure the prerequisites are in order too:
Let us know how you do.
Mike
If you are not running a desktop you should use :
ILocation myLocation = Qlik.Engine.Location.LocalServer;
if the qlik engine is running on the same machine or better would be to use
Uri uri = new Uri("http://<machine>:<port>");
ILocation remoteQlikSenseLocation = Qlik.Engine.Location.FromUri(uri);
where port should be 4747.
Thanks both Lars-Goran and Michael!
I still can't get around this, if you say nothing should be pointing at 4848, and I have not specified any ports myself, my Proxy settings looks like Michaels.
I did two tests, incorporated your advice.
Test1)
( Note! 4848 is NOT configured by my anywhere, netstat shows listening port as 4747)
ILocation myLocation = Qlik.Engine.Location.LocalServer;
using (IHub hub = myLocation.Hub())
{
MessageBox.Show(hub.QvVersion());
}
Results in:
SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:4848
Test2)
Uri uri = new Uri("http://win7devbox:4747");
ILocation myLocation = Qlik.Engine.Location.FromUri(uri);
// ILocation myLocation = Qlik.Engine.Location.LocalServer;
using (IHub hub = myLocation.Hub())
{
MessageBox.Show(hub.QvVersion());
}
Results in:
System.TimeoutException was thrown: "QlikConnection "Open" timed out"
So yes, it does seems like I cannot reach port 4747, but according to netstat it's listening.
I haven't started to remove certificiates yet, BUT this is a clean 1.0GA install on a squeaky clean Win7 install.
Ok, Michael, so I checked the certificates, seems something wrong. I didn't find any Trusted Root Certification Authorities created by QlikSense, only a CurrentUser/Personal ceritificate named QlikClient.
Is this where everything goes wrong? Hmm, it's just strange, on a fresh install with bascially installing by next-next-next....
If the uri fails to resolve it will default to "ws://127.0.0.1:4848", the uri could fail to resolve if you are running with too low rights to see the Sense instance in the list of running processes or if the process is called something else than QlikSense or Engine.
one workaround would be to specify the Uri explicitly as you are doing, but then you also need specify explicitly the way to authenticate.
var location = Location.FromUri(uri);
location.AsNtlmUserViaProxy();
or
var location = Location.FromUri(uri);
location.AsStaticHeaderUserViaProxy("<userId>");