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.
Assembly: System.Web.Services (in System.Web.Services.dll)
public: property SoapHeaderDirection Direction { SoapHeaderDirection get (); void set (SoapHeaderDirection value); }
Property Value
Type: System.Web.Services.Protocols::SoapHeaderDirectionThe 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(){} };
#using <mscorlib.dll>
#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 __gc class MyHeader : public SoapHeader {
public:
String* MyValue;
};
public __gc class MyWebService {
// Member variable to receive the contents of the MyHeader SOAP header.
public:
MyHeader* myHeader;
[WebMethod]
[SoapHeader(S"myHeader", Direction=SoapHeaderDirection::InOut)]
void Hello() {
}
};
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.