This documentation is archived and is not being maintained.

SoapHeaderCollection.Add Method

Adds a SoapHeader to the SoapHeaderCollection.

[Visual Basic]
Public Function Add( _
   ByVal header As SoapHeader _
) As Integer
[C#]
public int Add(
 SoapHeader header
);
[C++]
public: int Add(
 SoapHeader* header
);
[JScript]
public function Add(
   header : SoapHeader
) : int;

Parameters

header
The SoapHeader to add to the SoapHeaderCollection.

Return Value

The position at which the SoapHeader was inserted.

Example

[Visual Basic] 
mySoapHeader = New MySoapHeader()
mySoapHeader.text = "This is the second SOAP header"
mySoapHeaderCollection.Add(mySoapHeader)

[C#] 
mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This is the second SOAP header";
mySoapHeaderCollection.Add(mySoapHeader);

[C++] 
mySoapHeader = new MySoapHeader();
mySoapHeader->text = S"This is the second SOAP header";
mySoapHeaderCollection->Add(mySoapHeader);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

SoapHeaderCollection Class | SoapHeaderCollection Members | System.Web.Services.Protocols Namespace | Add | SoapHeader | IList

Show: