SoapHeaderCollection.CopyTo(SoapHeader[], Int32) Method

Definition

Copies the elements of the SoapHeaderCollection to an Array, starting at a particular index of the Array.

C#
public void CopyTo(System.Web.Services.Protocols.SoapHeader[] array, int index);

Parameters

array
SoapHeader[]

The one-dimensional Array that is the destination of the elements copied from SoapHeaderCollection. The array must have zero-based indexing.

index
Int32

The zero-based index in the array parameter at which copying begins.

Exceptions

The array parameter is null.

The index parameter is less than zero.

The array parameter is multidimensional.

-or-

The number of elements in the source SoapHeaderCollection is greater than the available space from the index parameter to the end of the destination array.

Examples

C#
mySoapHeaders = new MySoapHeader[mySoapHeaderCollection.Count];
mySoapHeaderCollection.CopyTo(mySoapHeaders, 0);

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also