This documentation is archived and is not being maintained.

AddressHeader.CreateAddressHeader Method (String, String, Object, XmlObjectSerializer)

Creates a new instance of the AddressHeader class with a specified name and namespace that uses a specified formatter to serialize the information item from a specified object.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public static AddressHeader CreateAddressHeader(
	string name,
	string ns,
	Object value,
	XmlObjectSerializer serializer


Type: System.String

The name of the address header.

Type: System.String

The namespace of the address header.

Type: System.Object

The information item for the address header.

Type: System.Runtime.Serialization.XmlObjectSerializer

The XmlObjectSerializer used to serialize the specified object in the value parameter.

Return Value

Type: System.ServiceModel.Channels.AddressHeader
The AddressHeader with the specified name and ns that contains the information item specified by value.


name or serializer is null or name.Length == 0.

The following example shows how to create an address header using this method.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

.NET Compact Framework

Supported in: 3.5