<basicHttpBinding> 的 <transport>
为 HTTP 传输定义控制身份验证参数的属性。
架构层次结构
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding>
<basicHttpBinding> 的 <security>
<basicHttpBinding> 的 <transport>
语法
<basicHttpBinding>
<binding>
<security
mode="None|Transport|Message|TransportWithMessageCredential|TransportCredentialOnly">
<transport clientCredentialType="None|Basic|Digest|Ntlm|Windows"
proxyCredentialType="None|Basic|Digest|Ntlm|Windows" realm="string" >
<extendedProtectionPolicy
policyEnforcement="Never|WhenSupported|Always"
protectionScenario="TransportSelected|TrustedProxy">
<customServiceNames></customServiceNames>
</extendedProtectionPolicy>
</transport>
</security>
</binding>
</basicHttpBinding>
属性和元素
以下几节描述了属性、子元素和父元素。
属性
属性 | 说明 |
---|---|
clientCredentialType |
|
proxyCredentialType |
|
realm |
一个字符串,指定摘要式或基本身份验证的 HTTP 身份验证方案所使用的领域。默认值为一个空字符串。 |
policyEnforcement |
此枚举指定应何时强制实施 ExtendedProtectionPolicy。
|
protectionScenario |
此枚举指定此策略强制实施的保护方案。 |
子元素
None
父元素
元素 | 说明 |
---|---|
定义 <basicHttpBinding>的安全功能。 |
示例
下面的示例演示如何对基本绑定使用 SSL 传输安全。默认情况下,基本绑定支持 HTTP 通信。
<system.serviceModel>
<services>
<service
type="Microsoft.ServiceModel.Samples.CalculatorService"
behaviorConfiguration="CalculatorServiceBehavior">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="Binding1"
contract="Microsoft.ServiceModel.Samples.ICalculator" />
</service>
</services>
<bindings>
<basicHttpBinding>
<!-- Configure basicHttpBinding with Transport security -- >
<!-- mode and clientCredentialType set to None.-->
<binding name="Binding1">
<security mode="Transport">
<transport clientCredentialType="None"
proxyCredentialType="None">
<extendedProtectionPolicy
policyEnforcement="WhenSupported"
protectionScenario="TransportSelected">
<customServiceNames></customServiceNames>
</extendedProtectionPolicy>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
另请参见
参考
Transport
Transport
HttpTransportSecurityElement
HttpTransportSecurity
概念
其他资源
Securing Services and Clients
Windows Communication Foundation Bindings
Configuring System-Provided Bindings
Using Bindings to Configure Services and Clients