This documentation is archived and is not being maintained.

SoapHeader::Actor Property

Gets or sets the recipient of the SOAP header.

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

public:
property String^ Actor {
	String^ get ();
	void set (String^ value);
}

Property Value

Type: System::String
The recipient of the SOAP header. The default is an empty string ("").

To set the recipient of a SOAP header, set the Actor property. Regardless of the version of the SOAP protocol used to communicate with an XML Web service, the .NET Framework automatically generates the SOAP message specific to the version of the SOAP protocol. Specifically, the XML element and XML namespace representing the recipient differ for the two versions.

XML Web services receiving the SOAP header can get the intended recipient by getting either the Role or Actor properties.

The recipient(s) for the Body element and each of the SOAP headers within the Header element of a SOAP message need not be the same. If a Header element exists in the SOAP message, it represents additional data that can be sent to and from the XML Web service method or an intermediary. The recipient of that data, known as the SOAP Actor in version 1.1, can be a different URI than the URI for the XML Web service method.

For more information on the SOAP actor attribute, see the SOAP specification at http://www.w3.org/TR/SOAP/.

The following XML Web service client calls the MyWebMethod XML Web service method after creating a custom SOAP header of type MyHeader and setting the Actor property to http://www.contoso.com/MySoapHeaderHandler.


int main()
{
   MyWebService^ ws = gcnew MyWebService;
   try
   {
      MyHeader^ customHeader = gcnew MyHeader;
      customHeader->MyValue = "Header Value for MyValue";
      customHeader->Actor = "http://www.contoso.com/MySoapHeaderHandler";
      ws->myHeader = customHeader;
      int results = ws->MyWebMethod( 3, 5 );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception: {0}", e );
   }

}



.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: