NonDualMessageSecurityOverHttp.EstablishSecurityContext 属性

定义

获取或设置一个值,该值指示是否建立安全上下文令牌。

public:
 property bool EstablishSecurityContext { bool get(); void set(bool value); };
public bool EstablishSecurityContext { get; set; }
member this.EstablishSecurityContext : bool with get, set
Public Property EstablishSecurityContext As Boolean

属性值

Boolean

如果已建立安全上下文令牌,则为 true;否则为 false

示例

下面的代码演示如何设置此属性。

WSHttpBinding binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.AlgorithmSuite =
    System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256;
binding.Security.Message.EstablishSecurityContext = true;
Dim binding As New WSHttpBinding()
binding.Security.Mode = SecurityMode.Message
binding.Security.Message.AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256
binding.Security.Message.EstablishSecurityContext = True

注解

此属性控制安全上下文令牌是否通过客户端与服务之间的 WS-SecureConversation 交换建立。 将其设置为 true 要求远程方支持 WS-SecureConversation。

适用于