Connect to Remotely Hosted WCF Service via netTcpBinding - wcf

I can connect to my WCF service locally with no problem but when I host it remotely, I receive this error:
TCP error code 10061: No connection could be made because the target machine actively refused it 192.168.200.58:1991.
Please note that he firewall is already turned off on the host.
I cannot figure out what is wrong. Any help?
Thanks!

Looks like a firewall problem. Check you port 1991 open on the target and client machines

Try using the command (which requires elevated permissions - run as administrator)
netstat -anb
You have likely already searched but I found another question that might guide you to your answer;
WCF No connection could be made because the target machine actively refused

Related

Unable to connect to different HTTP port on server

I am new to WCF Services, I have developed a WCF service library hosted within a Windows Service. The service end point is http://servername:9980/ApplicationServer/ServiceName.
When I run this service on local system and try to connect using my application, everything works fine.
The problem starts when I deploy this service on server system, none of my application can use this service, even the browser says page not found. Though, if I remove the specific port number from the endpoint all works well.
I have already opened all the ports in Windows Firewall including Client and Server. Also proper exceptions are made to the router firewall, still I am not able to host the service on specific port. I have even tried by switching firewall off on both client and server system.
Thank you in advance.
-Ashish Sharma
When you remove the specific port number it defaults to port 80.
So there is something that is blocking the other port.
Try using the Telnet command to check if the port is open (you may have to enable telnet)
As you have allready checked the firewalls, it could be urlscan or a network device.

Can't connect to a remote wcf service from IIS

I am able to connect to a remote WCF service from a console or a website/webapplication running on a VS dev server successfully. However, when I try to connect from an IIS hosted website I'm getting the following error. Any idea?
No connection could be made because the target machine actively refused it 12.11.121.12:80
This error:
No connection could be made because the target machine actively refused it
Means that a connection request successfully got through to the target machine (it isn't a firewall issue), on a given port and the target machine was not listening for incoming connections on that port, so the OS refused the connection attempt.
The rest of your error identifies the machine 12.11.121.12 and the port number 80 that the connection was attempted on.
The error indicates that a server isn't running on the target machine. If you know a server is running on the machine you're attempting to connect to, because you can connect to it from another application, then this suggests that your connection details are misconfigured in the website.
So, some things to check:
Are there any differences between the app.config/web.config configuration details for the target webservice? Specifically, the machine name (12.11.121.12) and the port number (80) would seem potentials.
Are you running the IIS hosted website on the same machine as the console/web application that works? If not, do both machines resolve the target server name (are you using someserver.org for example rather than 12.11.121.12 and it is being resolved to a different IP because one server is external facing and the other is internal?
This sounds a lot like a permissions (authentication issue) since the app pool is running under a different user (machine) by default. Since WCF uses the authentication token, I will bet this is your issue. Try setting the identity of the pool to the same user as the console, and I bet it will work fine.
Strangely I got this error when useDefaultWebProxy was "true" from a Web App, but exactly the same code and settings worked ok in a unit test class.
It turns out that the Web App was using the web-browser proxy (corporate policy) of https://foo/bar:1234. When I set this explicitely using:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name=...
useDefaultWebProxy="false" proxyAddress="https://foo/bar:1234"
...
I got the error:
The ServicePointManager does not support proxies with the https scheme
So I changed the proxy address to http, not https, and it worked.

Connecting to Zend Debugger on remote server

I am having great difficulty connecting to the zend debugger on a dreamhost account.
I get the following error message.
Failed to connect to host '192.168.11.7'. Failed to connect to host '192.168.56.1'. Failed to connect to host '127.0.0.1'.
Is this a problem with the debugger not being able to connect to my local machine? Do I need to forward a port on my router perhaps?
I have also added my external ip to the allowed hosts but to no avail.
Any hints much appreciated,
thanks
Is XDebug enable on Dreamhost - not sure it is. You can port forward using an SSH shell, Check here

Connection refused - nettcp WCF Service from work - client connecting over VPN

Here's the scenario: A client machine has connected to the 'Work network' via VPN (Cisco VPN Client). The work network hosts a machine that has a WCF service with nettcp binding. The client tries to connect to this service and gets an exception as follows:
Could not connect to
net.tcp://workMachine:2010/SomeService.
The connection attempt lasted for a
time span of 00:00:01.3180754. TCP
error code 10061: No connection could
be made because the target machine
actively refused it workMachine:2010.
Things I tried:
Changed the Workgroup of the client
machine to the work network
workgroup
Added domain/username/password for the Windows Networking Password vault, so that it can be used to connect
Changed the wcf service path with an IP address instead of the workMachine name
Checked client machine firewalls and added to allow the wcf client through it
All above failed and didn't work.
Has anyone encountered similar issues?
The client machine is on Windows 7
SecurityMode of the WCF service is set to NONE - so that shouldn't be an issue.
Any insights will be helpful
You may need to supply client credentials explicitly through your proxy object.
Assume that the proxy object in the code below implements one of the ClientBase interfaces.
proxy.ClientCredentials.Windows.ClientCredential.UserName = "clientaccount";
proxy.ClientCredentials.Windows.ClientCredential.Password = "S3cr3t1337Pwd";
Could you - just for testing purposes - expose the same service on the same machine using a HTTP endpoint, and try to connect to that one from your VPN client?
NetTcp is an excellent choice behind the corporate firewall - just don't know how the Cisco VPN client might cause troubles here, that might not show up when using an http-based protocol. Just a wild guess for now, but if you have nothing else to go on, give it a try!
Marc
Just another thought to assist with debugging of these kind of issues, using CMD execute "netstat -a" (you can append the -o switch and find the related process id also) and see if the port in question is currently open, if it isn't you may have an issue with the SMSvcHost.exe (this is the Windows process for managing an IIS hosted TCP Service).
I've had this issue before and rectified it by restarting the following services (obviously you'll need to carefully consider this if you are dealing with a live production system):
NetTcpActivator (Net. Tcp Listening Adapter)
NetTcpPortSharing (Net. Tcp Port Sharing Service)
and possibly if relevant:
NetMsmqActivator (Net. Pipe Listener Adapter)
NetPipeActivator (Net. Pipe Listener Adapter)
Hope this helps someone!
J.

TCP communication on Vista

I have a very simple app I'm trying to get to run under TCP using WCF 3.5 on Vista Enterpise. The error I'm getting when trying to hit a WCF service at http://localhost:8080 (or any other port not reserved by http) is:
TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8080.
I've gotten this to work a few months ago, but I forgot how. I'm wondering if I have the port reserved or something...I've tried allowing the compiled executable through Windows Firewall and tried opening port 8080 for TCP through the firewall, but i get the same error. Any thoughts or ideas on where to look or what to check?
Thanks!
Try going to http://machinename:8080 - I've had Vista make firewall distinctions based on that before, especially if the Loopback adapter was installed
No dice. Changing localhost to the machine name doesn't let me in.
It's not http that is having the problem...localhost works fine there as well. But everything I've tried to do with tcp has faild with the same error. Completely frustrating as I know I've seen this work on this box before.
Edit to include commented answer: Just FYI, finally found the problem. Something was misnamed in the service's config file. I wish the error could have been a bit clearer, but all is well. Thanks!