MustUnderstandBehavior 类

定义

指示 Windows Communication Foundation (WCF) 不在 UnderstoodHeaders 集合中禁用标头的强制处理,根据 SOAP 1.1 和 1.2 规范,必须了解该集合。Instructs Windows Communication Foundation (WCF) to disable the mandatory processing of headers not in the UnderstoodHeaders collection that must be understood according to the SOAP 1.1 and 1.2 specifications.

public ref class MustUnderstandBehavior : System::ServiceModel::Description::IEndpointBehavior
public class MustUnderstandBehavior : System.ServiceModel.Description.IEndpointBehavior
type MustUnderstandBehavior = class
    interface IEndpointBehavior
Public Class MustUnderstandBehavior
Implements IEndpointBehavior
继承
MustUnderstandBehavior
实现

注解

默认情况下,当 WCF 客户端或服务运行时在 System.ServiceModel.Channels.MessageHeader 消息中遇到 MessageHeader.MustUnderstand 属性为 true 但标头不在 MessageHeaders.UnderstoodHeaders 消息的属性中的时,将引发异常。By default the WCF client or service runtime throws an exception when it encounters a System.ServiceModel.Channels.MessageHeader in a message for which the MessageHeader.MustUnderstand property is true but the header is not in the MessageHeaders.UnderstoodHeaders property for the message.

若要防止此行为,请使用 MustUnderstandBehavior 并将 ValidateMustUnderstand 属性设置为 falseTo prevent this behavior, use the MustUnderstandBehavior and set the ValidateMustUnderstand property to false. 通常情况下,它用在以下情形中:消息内容(如路由器服务)在别的某处进行中继,并未处理。Typically, this is used in scenarios where the message content is meant to be relayed somewhere else and not processed, such as a router service.

构造函数

MustUnderstandBehavior(Boolean)

使用指定值初始化 MustUnderstandBehavior 类的新实例。Initializes a new instance of the MustUnderstandBehavior class using the specified value.

属性

ValidateMustUnderstand

获取或设置一个值,该值指定是否确保按照 SOAP 1.1 和 1.2 规范理解了标头。Gets or sets a value that specifies whether to ensure that a header is understood according to the SOAP 1.1 and 1.2 specifications.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

显式接口实现

IEndpointBehavior.AddBindingParameters(ServiceEndpoint, BindingParameterCollection)

支持行为功能。Supports behavior functionality.

IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint, ClientRuntime)

ValidateMustUnderstand 的值分配给 ValidateMustUnderstand 属性。Assigns the value of ValidateMustUnderstand to the ValidateMustUnderstand property.

IEndpointBehavior.ApplyDispatchBehavior(ServiceEndpoint, EndpointDispatcher)

ValidateMustUnderstand 的值分配给 ValidateMustUnderstand 属性。Assigns the value of ValidateMustUnderstand to the ValidateMustUnderstand property.

IEndpointBehavior.Validate(ServiceEndpoint)

支持行为功能。Supports behavior functionality.

适用于