SoapHeader Class
When overridden in a derived class, represents the content of a SOAP header.
Assembly: System.Web.Services (in System.Web.Services.dll)
SOAP headers offer a method for passing data to and from an XML Web service method if the data is not directly related to the XML Web service method's primary functionality. For instance, an XML Web service might contain several XML Web service methods that each require a custom authentication scheme. Instead of adding parameters to each XML Web service method for the custom authentication scheme, a SoapHeaderAttribute, referring to a class deriving from SoapHeader, can be applied to each XML Web service method. The implementation for the class deriving from SoapHeader handles the custom authentication scheme. In this manner, the XML Web service method implements only the functionality specific to it and adds additional functionality using a SOAP header.
The following list outlines the basic steps to receiving and processing a SOAP header:
Create a class that derives from SoapHeader representing the data passed into the SOAP header.
Add a member to the class implementing an XML Web service or an XML Web service client proxy class, of the type created in the first step.
Apply a SoapHeaderAttribute to the XML Web service method or the corresponding method in the proxy class, specifying the member created in the second step in the MemberName property.
Within the XML Web service method or XML Web service client code, access the MemberName property to process the data sent in the SOAP header.
System.Web.Services.Protocols::SoapHeader
System.Web.Services.Protocols::SoapUnknownHeader
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.