在使用了WCF这样一款开发工具之后,我们会发现,它在安全性方面发挥了非常大的作用。不过在一定的环境中,我们又需要禁用安全性配置,那么这时我们应该如何操作呢?在这里就一起来了解一下WCF禁用安全配置的相关方法吧。
WCF禁用安全配置具体实现代码:
- < ?xml version="1.0" encoding="utf-8" ?>
- < configuration>
- < system.web>
- < compilation debug="true" />
- < /system.web>
- < system.serviceModel>
- < services>
- < service name="CertificateTest.Service.CalService"
- behaviorConfiguration="CalServiceBeConfig">
- < host>
- < baseAddresses>
- < add baseAddress = "http://localhost:8888/" />
- < /baseAddresses>
- < /host>
- < !--指定endpoint的bindingConfiguration属性-->
- < endpoint address ="CalService"
- binding="wsHttpBinding"
- contract="CertificateTest.Contract.ICalService"
- bindingConfiguration="noSecBinding">
- < identity>
- < /identity>
- < /endpoint>
- < /service>
- < /services>
- < behaviors>
- < serviceBehaviors>
- < behavior name="CalServiceBeConfig" >
- < serviceMetadata httpGetEnabled="True"/>
- < serviceDebug includeExceptionDetailInFaults="False" />
- < /behavior>
- < /serviceBehaviors>
- < /behaviors>
- < !--在binding这里禁用安全性-->
- < bindings>
- < wsHttpBinding>
- < binding name="noSecBinding">
- < security mode="None">< /security>
- < /binding>
- < /wsHttpBinding>
- < /bindings>
- < /system.serviceModel>
- < /configuration>
以上就是我们为大家介绍的WCF禁用安全配置相关内容。
【编辑推荐】