I'm trying to test a simple WCF tcp.net client / server app. WCF service is being hosted on Windows 7 IIS. I have enabled TCP nos in IIS. I have set up the app security by admin rights with administrative rights and setting up the IIS service application to run in the context, to administer generous security privileges. Approved
I have enabled tracing on the service app for troubleshooting whenever I run a simple method call against the service from the WCF Client app, I receive the following exception:
"Stream security is required, but no security reference was discussed. This is probably due to remote binding, StreamSecurityBindingElement is unavailable from Endpoint."
Here is My Client Configuration:
& lt; Bindings & gt; & Lt; NetTcpBinding & gt; & Lt; Binding name = "unprotected TCP" & gt; & Lt; Safety mode = "none" /> & Lt; / Binding & gt; & Lt; / NetTcpBinding & gt; & Lt; / Binding & gt;
Here is my service configuration:
& lt; Bindings & gt; & Lt; NetTcpBinding & gt; & Lt; Binding name = "unprotected TCP" & gt; & Lt; Safety mode = "none" /> & Lt; / Binding & gt; & Lt; / NetTcpBinding & gt; & Lt; / Binding & gt; & Lt; Services & gt; & Lt; Service name = "command service" behavior configuration = "debug servicebeavik" & gt; & Lt; Endpoint address = "" binding = "net TCP binding" binding configuration = "unprotected TCP" contract = "ProtoFFFFFF service.error" /> & Lt; / Services & gt; & Lt; / Services & gt; & Lt; Behavior & gt; & Lt; ServiceBehaviors & gt; & Lt; Transaction name = "debugServiceBehavior" & gt; & Lt; Service debug includes ExceptionDetailInFaults = "true" /> & Lt; / Behavior & gt; & Lt; / ServiceBehaviors & gt; & Lt; / Behavior & gt;
WCF does not 'like insecure communication - by default Wants to use safe and secure com channels The default security mode for netTcpBinding
is transport-level security with Windows certificates Can you use that default instead of closing everything? ?
If your server machine and all the customers calling it are on the same company LAN behind the firewall, then there really is no point in not using Windows credentials. To do this, use this compelling configuration:
& lt; Binding & gt; & Lt; NetTcpBinding & gt; & Lt; Binding name = "unprotected TCP" & gt; & Lt; Safety Mode = "Transportation" & gt; & Lt; Transport Customer Credential Type = "Windows" /> & Lt; / Safety & gt; & Lt; / Binding & gt; & Lt; / NetTcpBinding & gt; & Lt; / Binding & gt;
This security feature is very fast, often implemented in hardware on your network card, and the use of Windows credentials within the organization is usually the best way to go.
Why did you disable all security on netTcpBinding
and took it into this problem?
Comments
Post a Comment