[1] Problem description:
By default, many bindings in WCF are secure. Generally, either transport (tcpbinding) or message (wshttpbinding) security mode is used.
In addition, authentication is enabled for the client. Most developers do not want to enable the security mode because it is difficult to configure and develop the security mode of WCF. So how to do it?
[2] refer to Configuration:
The server can first set securitymode = "NONE ". This can be done either through the configuration file or throughCode. The configuration file method is provided here. Reference code:
<Wshttpbinding>
<Binding
Name = "bindingconfiguration">
<Security mode = "NONE">
<Transport clientcredentialtype = "NONE"/>
<Message
Clientcredentialtype = "NONE"/>
</Security>
</Binding>
</Wshttpbinding>
In addition, we need to use this binding to the corresponding endpoint Configuration:
Bindingconfiguration = "bindingconfiguration"
Example:
<Endpoint
Address = "wcfservice"
Binding = "wshttpbinding"
Bindingconfiguration = "bindingconfiguration"
Contract = "wcfservice. iwcfservice">
</Endpoint>
[3] client configuration: the client configuration also corresponds to it. It is best to add a service reference again. Update the client configuration. You can also manually update the file because the secure transmission and client verification are not used.
Therefore, the simplified client configuration is as follows:
<System. servicemodel>
<Bindings>
<Wshttpbinding>
<Binding
Name = "wshttpbinding_iwcfservice"/>
<Security
Mode = "NONE">
<Transport
Clientcredentialtype = "NONE"/>
<Message
Clientcredentialtype = "NONE"/>
</Security>
</Binding>
</Wshttpbinding>
binding =" wshttpbinding "
bindingconfiguration =" wshttpbinding_iwcfservice "
contract =" clientproxy. iwcfservice "
name =" wshttpbinding_iwcfservice "/>