WCF中具有安全配置。不过,在实际使用中我们有时会碰到需要关闭这一安全配置的环境。今天我们就来为大家介绍一下有关WCF禁用安全配置的相关知识。#t#
时不时会用到这个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 includeException
DetailInFaults="False" /> - < /behavior>
- < /serviceBehaviors>
- < /behaviors>
- < !--在binding这里禁用安全性-->
- < bindings>
- < wsHttpBinding>
- < binding name="noSecBinding">
- < security mode="None">< /security>
- < /binding>
- < /wsHttpBinding>
- < /bindings>
- < /system.serviceModel>
- < /configuration>
以上就是WCF禁用安全配置相关技巧讲解。