Redigera

Dela via


AddressHeaderCollection.FindHeader(String, String) Method

Definition

Finds the first address header in the collection with a specified name and namespace.

public:
 System::ServiceModel::Channels::AddressHeader ^ FindHeader(System::String ^ name, System::String ^ ns);
public System.ServiceModel.Channels.AddressHeader FindHeader (string name, string ns);
member this.FindHeader : string * string -> System.ServiceModel.Channels.AddressHeader
Public Function FindHeader (name As String, ns As String) As AddressHeader

Parameters

name
String

The name of the address header to be found.

ns
String

The namespace of the address header to be found.

Returns

The AddressHeader in the collection with the specified name and namespace.

Exceptions

name or ns is null.

There is more than one header that has the specified name and ns.

Examples

The following code snippet illustrates how to call this method.

Remarks

If you need to find all the address headers in the collection with the specified name and namespace, use the FindAll(String, String) method instead.

ArgumentException is not the ideal exception type when there is more than one header in the collection. Callers of this method should take care to handle this exception when the collection contains multiple entries with the same name and namespace.

Applies to