This documentation is archived and is not being maintained.

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.

[Visual Basic]
<Flags>
<Serializable>
Public Enum SoapHeaderDirection
[C#]
[Flags]
[Serializable]
public enum SoapHeaderDirection
[C++]
[Flags]
[Serializable]
__value public enum SoapHeaderDirection
[JScript]
public
   Flags
 Serializable
enum SoapHeaderDirection

Remarks

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.

Members

Member name Description Value
Fault Specifies the SoapHeader is sent to the XML Web service client when an exception is thrown by the XML Web service method. 4
In

Supported by the .NET Compact Framework.

Specifies the SoapHeader is sent to the XML Web service. 1
InOut

Supported by the .NET Compact Framework.

Specifies the SoapHeader is sent to both the XML Web service and the XML Web service client. 3
Out

Supported by the .NET Compact Framework.

Specifies the SoapHeader is sent to the XML Web service client. 2

Example

[Visual Basic, C#, C++] 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.

[Visual Basic] 
Public Class MyHeader
    Inherits SoapHeader
    Public MyValue As String
End Class

Public Class MyWebService
    
    Public myHeader As MyHeader    
    
    <WebMethod, _
    SoapHeader("myHeader", _
                Direction := SoapHeaderDirection.InOut Or SoapHeaderDirection.Fault)> _
    Public Sub MySoapHeaderReceivingMethod()

        ' Set myHeader.MyValue to some value.
        
    End Sub
    
End Class


[C#] 
public class MyHeader : SoapHeader {
    public string MyValue;
}

public class MyWebService {

    public MyHeader myHeader;

    [WebMethod]
    [SoapHeader("myHeader", 
                Direction=SoapHeaderDirection.InOut | SoapHeaderDirection.Fault)]
    public void MySoapHeaderReceivingMethod() {

        // Set myHeader.MyValue to some value.

    }
}
   

[C++] 
public __gc class MyHeader : public SoapHeader {
public:
    String* MyValue;
};

public __gc class MyWebService {

public:
    MyHeader* myHeader;

    [WebMethod]
    [SoapHeader(S"myHeader", 
                Direction=SoapHeaderDirection::InOut | SoapHeaderDirection::Fault)]
    void MySoapHeaderReceivingMethod() {

        // Set myHeader->MyValue to some value.

    }
};
   

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Web.Services.Protocols

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System.Web.Services (in System.Web.Services.dll)

See Also

System.Web.Services.Protocols Namespace | SoapHeaderAttribute | SoapHeader

Show: