Search code examples
c#.netiistcpwindows-server-2012

Error while trying to call a wcf service


I'm trying to connect to a WCF service on a server.

I've set up a Site in the IIS on the server and set the Enabled Protocols to http,net.tcp. Additionally, I configured the Site Bindings like this:

  • http > Port: 80 > IP Address: *
  • net.tcp > Binding Information: 808.*

Under Authentication, I've enabled Anonymous Authentication and Windows Authentication.

The services Net.Tcp Listener Adapter and Net.Tcp Port Sharing Service are running too.

When I call the webservice with a browser (via http), everything works and I can list the wsdl etc.

But when trying to connect via tcp, I get the following error:

Error: Cannot obtain Metadata from net.tcp://myserver/MyService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: net.tcp://myserver/MyService.svc Metadata contains a reference that cannot be resolved: 'net.tcp://myserver/MyService.svc'. Could not connect to net.tcp://myserver/MyService.svc. The connection attempt lasted for a time span of 00:00:21.0010999. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.x.yyy.zz:808. A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.x.yyy.zz:808

  • Are there any other things I have to make sure to be able to connect via tcp?

Thanks in advance


Solution

  • This seems to be a network issue since 10060 means connect timeout.

    1. Check the server firewall and make sure that Windows Communication Foundation Net.TCP Listener Adapter (TCP-In) rule is enabled.

    2. Check the client computer's firewall and add make sure an outbound rule allowing tcp connections on port 808

    3. If you still can't connect, a network firewall device might be blocking the request