Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SoapHeaderCollection::Insert Method (Int32, SoapHeader^)

 

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
)

Parameters

index
Type: System::Int32

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

header
Type: System.Web.Services.Protocols::SoapHeader^

The SoapHeader to insert into the SoapHeaderCollection.

Exception Condition
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 );

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft