NET TCP / HTTP WCF hosted in IIS

I am new to WCF and IIS, but have read about how to host a WCF application in IIS. We have a system that we are trying to deploy to IIS, which requires HTTP and NET.TCP endpoints. Everything is set up for me, as I saw in the random tutorials, but I still can’t connect to my client. Any help with the configuration would be greatly appreciated!

My EdWCF.svc file in my WCF directory:

< %@ ServiceHost Language="C#" Debug="true" Service="TwoFour.WCF.Engine.EdWCF" % > 

My Web.Config:

  <?xml version="1.0"?> <configuration> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="MyBehaviour"> <serviceMetadata HttpGetEnabled="True" /> </behavior> </serviceBehaviors> </behaviors> <service name="TwoFour.WCF.Engine.EdWCF" behaviorConfiguration="MyBehaviour"> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:12345/WCF/EdWCF.svc"/> </baseAddresses> </host> <endpoint address="" binding="netTcpBinding" bindingConfiguration="InsecureTcp" contract="TwoFour.WCF.Interface.Shared.IEdWCF" /> <endpoint address="mexhttp" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> <bindings> <netTcpBinding> <binding name="InsecureTcp" portSharingEnabled="true"> <security mode="None" /> </binding> </netTcpBinding> </bindings> </system.serviceModel> </configuration> 

Thanks for any help or suggestions!

+7
source share
1 answer
  • In IIS, add the net.tcp binding to the list of enabled protocols (Mange website β†’ Presets β†’ Enabled protocols)

  • In the binding to the site, add the net.tcp binding (Edit Binding β†’ Add β†’ Select the type as net.tcp and add a port like this 12345: *)

You also need to specify the base address in your configuration:

 <system.serviceModel> <services> <host> <baseAddresses> <add baseAddress="net.tcp://server:12345/ServiceAddress.svc"/> </baseAddresses> </host> ... </service> ... </system.serviceModel> 

Edit:

try it

 <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="MyBehaviour"> <serviceMetadata /> </behavior> </serviceBehaviors> </behaviors> <service name="TwoFour.WCF.Engine.EdWCF" behaviorConfiguration="MyBehaviour"> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:12345/WCF/EdWCF.svc"/> </baseAddresses> </host> <endpoint address="" binding="netTcpBinding" bindingConfiguration="InsecureTcp" contract="TwoFour.WCF.Interface.Shared.IEdWCF" /> <endpoint address="mextcp" binding="mexTcpBinding" contract="IMetadataExchange"/> </service> <bindings> <netTcpBinding> <binding name="InsecureTcp" portSharingEnabled="true"> <security mode="None" /> </binding> </netTcpBinding> </bindings> </system.serviceModel> 
+13
source

All Articles