SoapHeaderDirection Enumeration
Specifies whether the recipient of the SoapHeader is the XML Web service, the XML Web service client, or both.
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Namespace: System.Web.Services.ProtocolsAssembly: System.Web.Services (in System.Web.Services.dll)
| Member name | Description | |
|---|---|---|
| In | Specifies the SoapHeader is sent to the XML Web service. | |
| Out | Specifies the SoapHeader is sent to the XML Web service client. | |
| InOut | Specifies the SoapHeader is sent to both the XML Web service and the XML Web service client. | |
| Fault | Specifies the SoapHeader is sent to the XML Web service client when an exception is thrown by the XML Web service method. |
A SoapHeaderAttribute can be applied to either an XML Web service method or a method of a proxy class to an XML Web service. In either case, the recipient(s) are specified by the Direction property of SoapHeaderAttribute. To specify that an XML Web service method returns a SOAP header when an exception is thrown during its execution, apply an SoapHeaderAttribute to the method and set the Direction property to Fault.
Version 1.0 of the .NET Framework does not support the Fault value.
The following XML Web service method specifies that the myHeader SoapHeader is sent from the XML Web service client to the XML Web service and then back to the XML Web service client, regardless of an exception thrown during execution of the XML Web service method.
public ref class MyHeader: public SoapHeader { public: String^ MyValue; }; public ref class MyWebService { public: MyHeader^ myHeader; [WebMethod] [SoapHeader("myHeader", Direction=SoapHeaderDirection::InOut|SoapHeaderDirection::Fault)] void MySoapHeaderReceivingMethod() { // Set myHeader->MyValue to some value. } };
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.