SoapHeaderCollection.Insert Method

Inserts a SoapHeader into the SoapHeaderCollection at the specified index.

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

public:
void Insert (
	int index, 
	SoapHeader^ header
)
public void Insert (
	int index, 
	SoapHeader header
)
public function Insert (
	index : int, 
	header : SoapHeader
)
Not applicable.

Parameters

index

The zero-based index at which to insert the SoapHeader into the SoapHeaderCollection.

header

The SoapHeader to insert into the SoapHeaderCollection.

Exception typeCondition

ArgumentOutOfRangeException

The index parameteris not a valid index in the SoapHeaderCollection.

If the index parameter equals the number of items in the collection, then the SoapHeader is appended to the end of the collection.

The SoapHeader elements after the insertion point move down to accommodate the new element.

mySoapHeader = gcnew MySoapHeader;
mySoapHeader->text = "This header is inserted before the first header";
mySoapHeaderCollection->Insert( 0, mySoapHeader );

mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This header is inserted before the first header";
mySoapHeaderCollection.Insert(0, mySoapHeader);

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: