I created a simple WCF service and hosted it in IIS by creating a new website. In Web.config file,I am providing bindings for http and net tcp. I created a console client and adding service reference. It generates two binding in client config - for http and for tcp. When I try to invoke the service using tcp, I get this error -
An unhandled exception of type 'System.ServiceModel.EndpointNotFoundException' occurred in mscorlib.dll Additional information: There was no endpoint listening at net.tcp://agoel.extron.com/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action.
when I run using Http endpoint , it works fine. Note - I am using Windows 10 OS, IIS 10.0 and WPAS\WAS (Windows Process Activation Service) are installed. I already enabled\checked HTTP Activation, TCP Activation in .Net framework in Windows features. And modified IIS server settings to include net tcp.
My website Web.config file looks like
- <system.serviceModel>
- <bindings>
- <netTcpBinding>
- <binding name="NewBinding0" portSharingEnabled="true">
- <security mode="None" />
- binding>
- netTcpBinding>
- bindings>
- <services>
- <service behaviorConfiguration="My" name="WCFServiceOM.Service1">
- <endpoint address="" binding="basicHttpBinding" contract="WCFServiceOM.IService1"/>
- <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
- <endpoint binding="netTcpBinding" bindingConfiguration="NewBinding0" contract="WCFServiceOM.IService1" />
- <endpoint address="mexOM" binding="mexTcpBinding" contract="IMetadataExchange"/>
- <host>
- <baseAddresses>
- <add baseAddress="net.tcp://localhost:8087/Service1" />
- <add baseAddress="http://localhost:7777/Service1"/>
- baseAddresses>
- host>
- service>
- services>
- <behaviors>
- <endpointBehaviors>
- <behavior name="webBehanior">
- <webHttp/>
- behavior>
- endpointBehaviors>
- <serviceBehaviors>
- <behavior name="My">
-
- <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
-
- <serviceDebug includeExceptionDetailInFaults="true"/>
- behavior>
- serviceBehaviors>
- behaviors>
And my client App.Config look like
- <configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
- startup>
- <system.serviceModel>
-