Export (0) Print
Expand All

AddressHeader.GetValue<T> Method

Deserializes the information item from the current address header to an object of a specified type.

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

public T GetValue<T>()

Type Parameters

T

A class of type T with its fields and properties set to the values supplied by the current address header object.

Return Value

Type: T
An instance of a class of type T with its fields and properties set to the values supplied by the current address header object.

When using this overload, you must supply a type for the generic parameter T. The type of the return value is determined by the generic type parameter.

Use the GetValue<T>(XmlObjectSerializer) overload if you want to use a customized XML formatter.

The following example shows how to call this method.


//Create address headers with XmlObjectSerializer specified
XmlObjectSerializer serializer = new DataContractSerializer(typeof(int));
AddressHeader addressHeaderWithObjSer = AddressHeader.CreateAddressHeader("MyServiceName", "http://localhost:8000/service", 1, serializer);
int value = addressHeaderWithObjSer.GetValue<int>();


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft