SoapHeaderAttribute.Required 属性



此 API 现已过时。

此成员已经过时,不具有任何功能。This member is obsolete and has no functionality.

 property bool Required { bool get(); void set(bool value); };
[System.Obsolete("This property will be removed from a future version. The presence of a particular header in a SOAP message is no longer enforced", false)]
public bool Required { get; set; }
member this.Required : bool with get, set
Public Property Required As Boolean


一个 Boolean 值。A Boolean value.



若要验证是否已将 SOAP 标头发送到 XML Web service, 请确认在MemberName属性中指定的成员为。 nullTo verify that a SOAP header is sent to an XML Web service, confirm that the member specified in the MemberName property is null. 如果为null, 则不发送 SOAP 标头。If it is null, the SOAP header was not sent.

在 .NET Framework SDK 版本1.0 中, Required属性指示接收方 XML Web service 或 XML Web service 客户端是否必须理解并处理 SOAP 标头。In version 1.0 of the .NET Framework SDK, the Required property indicates whether a SOAP header must be understood and processed by the recipient XML Web service or XML Web service client. 如果收件人未处理 SOAP 标头, 则会引发异常。If a recipient did not process the SOAP header an exception was thrown.