IIS8 There was no endpoint listening at net.tcp:
Asked Answered
R

3

6

i have a WCF service host in IIS8 and I want to use a net.tcp binding.

I have this configuration:

Web.config:

<service behaviorConfiguration="MyBehavior"
  name="DecryptService.EmailCenterDecryptTCP">
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://XX.XX.XX.XX:808/VirtualFolder/Service.svc" />
      </baseAddresses>
    </host>

    <endpoint address=""
          binding="netTcpBinding"
          bindingConfiguration="portSharingBinding"
          name="MyServiceEndpoint"
          contract="ServiceNamespace.IService">
    </endpoint>

    <endpoint address="mextcp"
          binding="mexHttpBinding"
          bindingConfiguration=""
          name="MyServiceMexTcpBidingEndpoint"
          contract="IMetadataExchange" />
</service>

When I try to consume the service in the same machine as IIS8 with the following configuration works fine:

<client>
        <endpoint address="net.tcp://YY.YY.YY.YY:808/VirtualFolder/Service.svc"
            binding="netTcpBinding" bindingConfiguration="MyServiceEndpoint"
            contract="ServiceReference1.IService" name="MyServiceEndpoint" />
    </client>

YY.YY.YY.YY is the local IP of machine but when I try to consume the service in another machine changing YY.YY.YY.YY to external IP of the machine (ZZ.ZZ.ZZ.ZZ) that runs IIS8 I get the following error:

There was no endpoint listening at net.tcp://ZZ.ZZ.ZZ.ZZ/VirtualFolder/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

Any Ideas? Thanks and sorry for my bad English

EDIT:

I made a console application running a ServiceHost replacing IIS and with this configuration it works over internet

var svh = new ServiceHost(typeof (Service));
svh.AddServiceEndpoint(typeof (ServiceNamespace.IService), new NetTcpBinding(SecurityMode.None), "net.tcp://serverLocalIp:808");
svh.Open();

Console.WriteLine("SERVER - Running...");
stopFlag.WaitOne();

Console.WriteLine("SERVER - Shutting down...");
svh.Close();

Console.WriteLine("SERVER - Shut down!");

Any idea whats wrong with IIS running the same service over internet? locally works. Thanks

Rising answered 5/4, 2013 at 16:26 Comment(0)
O
8

You also need to setup IIS to receive a Net.TCP connection.

Under Advanced Settings of your IIS Application, then under Enabled Protocols make sure you have http,net.tcp note that there is no space, if you have a space it will fail.

http://blogs.msdn.com/b/swiss_dpe_team/archive/2008/02/08/iis-7-support-for-non-http-protocols.aspx

Obsecrate answered 5/4, 2013 at 16:40 Comment(5)
But if I have a space in 'http,net.tcp' shouldn't fail even for local calls?Rising
I reviewed IIS and i have everything ok.. the problem is that if i call the service from the same machine as IIS8 is running (localhost) everything works fine but when i call the same service outside the machine that runs IIS i get that errorRising
Sounds like a firewall is blocking you then.Obsecrate
i made a console application using a ServiceHost and ran it in the same machine as IIS8 and with self hosted service it works... maybe something with the address?Rising
I'm so glad I found your answer. I lost a whole day because of a space.Pericycle
I
8

If you started receiving this error out of the blue one day, it is related to another process hijacking the net.tcp port. In my case it was port 808. Here is how I figured it out after about 3 days--ya this is what I do nowadays, Google and try to figure out other people's fups instead of doing my own work.

Anyhow:


  1. Net.TCP depends on 2 windows services to be running. Go to services and find Net.Tcp Listener Adapter and Net.Tcp Port Sharing Service. If you do not see them, then this answer does not apply to you. It means you have not activated the feature in control panel Turn Windows feature on or off. You will find plenty info on what to enable online.
  2. Stop the the Net.Tcp Port Sharing Service and click Yes in the Stop Other Services popup.
  3. Restart both services.
  4. Open Event Viewer > Windows Logs > System and see if you see any error for SMSvcHost 4.0.0.0 (your version may differ) in the Source column. I had this error: An error occurred in the Activation Service 'NetTcpActivator' of the protocol 'net.tcp' while trying to listen for the site '1', thus the protocol is disabled for the site temporarily. Yes, thanks MS! You started a service but did not really start it and simply added a message to the Event Viewer? Great! Because telling me during the windows service start is too hard, correct? Ok again, anyways, let's keep going.
  5. Then I needed to figure out what is using the port as per error in 4 above. So I ran the following commands (You may need to start the command prompt in admin mode.)
    • Run netstat -ano | findstr "808" and note the numbers in last the column. Those are process IDs using the port.
    • Run tasklist /fi "pid eq 9", where 9 would be the process ID from above step.
  6. Now that you know the process name that is using the port, you need to Google and find out what the process is for. In my case it was a related to Intel graphics driver using port 808: OneApp.IGCC.WinService.exe.

That makes sense because some other process was already using port 808 so it wasn't available for Net.TCP.


I had 2 options at this point:

  1. Disable that process
  2. Perhaps see if I can change the port for it.

Luckily they have an update for the driver already so I simply downloaded it and installed it from here.


Reboot then ran the following commands again to ensure the port is free for net.tcp:

  1. Run netstat -ano | findstr "808" and note the numbers in the last column. Those are process IDs using the port.
  2. Run tasklist /fi "pid eq 9", where 9 would be the process ID from above step. Now you should see SMSvcHost.exe which is what we want.

Izmir answered 11/11, 2020 at 22:25 Comment(2)
Thanks Yoshi. I have spent a lot of time to figured out the issue but no luck and your answer is solved my problem.Coff
I will request the author of the issue to mark this as the answer so it will be helpful for others.Coff
K
0

Simple answer, change port number under IIS -> edit bindings -> net.tcp to something else. I changed it to 12345 and this solved my problem.

This is issue related to another process using default port 808 as explained in post above. If this doesn't help, check answer above and fallow procedure.

Kellykellyann answered 29/11, 2020 at 12:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.