How do I configure not to enable secure WCF services? Carrier)

Source: Internet
Author: User

[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 "/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.