Export (0) Print
Expand All
Expand Minimize
0 out of 1 rated this helpful - Rate this topic

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.Protocols
Assembly: System.Web.Services (in system.web.services.dll)
[FlagsAttribute] 
public enum SoapHeaderDirection
/** @attribute FlagsAttribute() */ 
public enum SoapHeaderDirection
FlagsAttribute 
public enum SoapHeaderDirection
 Member nameDescription
Supported by the .NET Compact FrameworkFaultSpecifies the SoapHeader is sent to the XML Web service client when an exception is thrown by the XML Web service method. 
Supported by the .NET Compact FrameworkInSpecifies the SoapHeader is sent to the XML Web service. 
Supported by the .NET Compact FrameworkInOutSpecifies the SoapHeader is sent to both the XML Web service and the XML Web service client. 
Supported by the .NET Compact FrameworkOutSpecifies the SoapHeader is sent to the XML Web service client. 

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 myHeaderSoapHeader 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 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.

    }
}
   

public class MyHeader extends SoapHeader
{
    public String myValue;
} //MyHeader

public class MyWebService
{
    public MyHeader myHeader;

    /** @attribute WebMethod()
     */
    /** @attribute SoapHeader("myHeader", Direction = 
         SoapHeaderDirection.InOut | SoapHeaderDirection.Fault)
     */

    public void MySoapHeaderReceivingMethod()
    {
        // Set myHeader.myValue to some value.
    } //MySoapHeaderReceivingMethod
} //MyWebService

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.