WCF禁用安全配置相关代码剖析

在使用了WCF这样一款开发工具之后,我们会发现,它在安全性方面发挥了非常大的作用。不过在一定的环境中,我们又需要禁用安全性配置,那么这时我们应该如何操作呢?在这里就一起来了解一下WCF禁用安全配置的相关方法吧。

WCF禁用安全配置具体实现代码:

 
 
 
  1. < ?xml version="1.0" encoding="utf-8" ?> 
  2. < configuration> 
  3. < system.web> 
  4. < compilation debug="true" /> 
  5. < /system.web> 
  6. < system.serviceModel> 
  7. < services> 
  8. < service name="CertificateTest.Service.CalService"   
  9. behaviorConfiguration="CalServiceBeConfig"> 
  10. < host> 
  11. < baseAddresses> 
  12. < add baseAddress = "http://localhost:8888/" /> 
  13. < /baseAddresses> 
  14. < /host> 
  15. < !--指定endpoint的bindingConfiguration属性--> 
  16. < endpoint address ="CalService"   
  17. binding="wsHttpBinding" 
  18. contract="CertificateTest.Contract.ICalService" 
  19. bindingConfiguration="noSecBinding"> 
  20. < identity> 
  21. < /identity> 
  22. < /endpoint> 
  23. < /service> 
  24. < /services> 
  25. < behaviors> 
  26. < serviceBehaviors> 
  27. < behavior name="CalServiceBeConfig" > 
  28. < serviceMetadata httpGetEnabled="True"/> 
  29. < serviceDebug includeExceptionDetailInFaults="False" /> 
  30. < /behavior> 
  31. < /serviceBehaviors> 
  32. < /behaviors> 
  33. < !--在binding这里禁用安全性--> 
  34. < bindings> 
  35. < wsHttpBinding> 
  36. < binding name="noSecBinding"> 
  37. < security mode="None">< /security> 
  38. < /binding> 
  39. < /wsHttpBinding> 
  40. < /bindings> 
  41. < /system.serviceModel> 
  42. < /configuration> 

以上就是我们为大家介绍的WCF禁用安全配置相关内容。

【编辑推荐】

  1. WCF tcpTrace实现功能浅析
  2. WCF单向协定基本创建步骤解析
  3. WCF返回自定义格式具体应用技巧详解
  4. WCF响应服务基本应用技巧分享
  5. WCF排队调用由NetMsmqBinding支持
THE END