time 
设为首页】【收藏本站
当前位置: 主页 > 程序设计 > .net > WCF > WCF wsHttpBinding使用Transport security Mode且lientCredentialType=”Basic”

WCF wsHttpBinding使用Transport security Mode且lientCredentialType=”Basic”

时间:2015-01-08 14:22 点击:2883次 字体:[ ]




如何在WCF中使用Transport Security Mode,以及如何创建证书,请参见http://www.fengfly.com/plus/view-215505-1.html,本文介绍如何使用Basic clientCredentialType。

server web.config

  1. <?xml version="1.0"?>   
  2. <configuration>   
  3.     <system.web>   
  4.       <compilation debug="true" targetFramework="4.0" />   
  5.     </system.web>   
  6.     <system.serviceModel>   
  7.       <bindings>   
  8.         <wsHttpBinding>   
  9.           <binding name="wsHttpBindingConfig">   
  10.             <security mode="Transport">   
  11.               <transport clientCredentialType="Basic" />   
  12.             </security>   
  13.           </binding>   
  14.         </wsHttpBinding>   
  15.       </bindings>   
  16.       <services>   
  17.         <service name="WCFDemo.DemoService" behaviorConfiguration="CustomBehavior">   
  18.           <endpoint address="DemoService" binding="wsHttpBinding" contract="WCFDemo.IDemoService" bindingConfiguration="wsHttpBindingConfig" />            
  19.           <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>   
  20.         </service>   
  21.       </services>   
  22.         <behaviors>   
  23.             <serviceBehaviors>   
  24.                 <behavior name="CustomBehavior">   
  25.                     <serviceMetadata httpsGetEnabled="true" />   
  26.                     <serviceDebug includeExceptionDetailInFaults="false" />                      
  27.                 </behavior>   
  28.             </serviceBehaviors>   
  29.         </behaviors>   
  30.         <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />   
  31.     </system.serviceModel>   
  32. </configuration> 

 

WCF wsHttpBinding使用Transport security Mode且lientCredentialType=”Basic”_www.fengfly.com

WCF wsHttpBinding使用Transport security Mode且lientCredentialType=”Basic”_www.fengfly.com

WCF wsHttpBinding使用Transport security Mode且lientCredentialType=”Basic”_www.fengfly.com

 



本文地址 : http://www.fengfly.com/plus/view-215506-1.html
标签: WCF WSHttpBinding Transport Security Mode clientCredentialType
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码: