I'm trying to get my WCF service working with netTcpBinding
instead of wsHttpBinding
, but I can't seem to get it working.
I added the net.tcp
binding to IIS7.5 but the status is Unknown (and when I also remove the http binding it puts a big red X through the site and I have to add a new http binding before I can access any settings again). I already looked here and on Google but I could only find two or three posts about this issue without any true solutions.
What I have:
- WAS service running, and also the Net.* services.
- Added net.tcp in Advanced Settings in IIS.
- WCF non-http is installed.
There seems to be a TCP listener running, as it shows in netstat that it is listening on my specified port: 809) and I also got firewall message (also tried disabling the firewall/antivirus, but it didn't help).
WCF Test Client results in this error:
Error: Cannot obtain Metadata from net.tcp://localhost:809/MyService.svc
My Web.config (as copied mostly from MSDN, for proper layout look here http://pastebin.com/Ru8p0T9N):
<services>
<service behaviorConfiguration="MyBehavior" name="WCFService.MyService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="Binding1" name="MyServiceEndpoint" contract="WCFService.MyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="MyServiceMexTcpBidingEndpoint" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:809/MyService.svc" />
</baseAddresses>
</host>
</service>
</services>
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<netTcpBinding>
<binding name="Binding1"hostNameComparisonMode="StrongWildcard"sendTimeout="00:10:00"maxReceivedMessageSize="65536"transferMode="Buffered"portSharingEnabled="true">
<security mode="Message">
<transport clientCredentialType="None" />
<message clientCredentialType="None" />
</security>
</binding>
</netTcpBinding>
Everything works fine with wsHttpBinding
but not with net.tcp
. I tried several different settings in the Web.config from multiple sources but I keep ending up with the same problem.