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
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
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:
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:
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With