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支持

分享名称:WCF禁用安全配置相关代码剖析
标题URL:http://www.shufengxianlan.com/qtweb/news16/23866.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联