SoapHeaderAttribute.Direction Property

Gets or sets whether the SOAP header is intended for the XML Web service or the XML Web service client or both.

Namespace: System.Web.Services.Protocols
Assembly: System.Web.Services (in system.web.services.dll)

public:
property SoapHeaderDirection Direction {
	SoapHeaderDirection get ();
	void set (SoapHeaderDirection value);
}
/** @property */
public SoapHeaderDirection get_Direction ()

/** @property */
public void set_Direction (SoapHeaderDirection value)

public function get Direction () : SoapHeaderDirection

public function set Direction (value : SoapHeaderDirection)

Not applicable.

Property Value

The intended recipient of the SOAP header. The default is In, which means the intended recipient is just the XML Web service.

The following MyWebService XML Web service defines one SoapHeader of type MyHeader. The Hello XML Web service method specifies that MyHeader must be sent to the XML Web service method and the client to invocate the XML Web service method.

#using <System.EnterpriseServices.dll>
#using <System.Web.Services.dll>

using namespace System;
using namespace System::Web::Services;
using namespace System::Web::Services::Protocols;

// Define a SOAP header by deriving from the SoapHeader base class.
// The header contains just one string value.
public ref class MyHeader: public SoapHeader
{
public:
   String^ MyValue;
};

public ref class MyWebService
{
public:

   // Member variable to receive the contents of the MyHeader SOAP header.
   MyHeader^ myHeader;

   [WebMethod]
   [SoapHeader("myHeader",Direction=SoapHeaderDirection::InOut)]
   void Hello(){}

};


import System.*;
import System.Web.Services.*;
import System.Web.Services.Protocols.*;

// Define a SOAP header by deriving from the SoapHeader base class.
// The header contains just one string value.
public class MyHeader extends SoapHeader
{
    public String myValue;
} //MyHeader

public class MyWebService
{
    // Member variable to receive the contents of the MyHeader SOAP header.
    public MyHeader myHeader;

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

    public void Hello()
    {
    } //Hello
} //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

Community Additions

ADD
Show: