在使用了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>
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
以上就是我们为大家介绍的WCF禁用安全配置相关内容。
【编辑推荐】