GetValue(T) Method
Collapse the table of content
Expand the table of content

AddressHeader.GetValue(Of T) Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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)

'Declaration
Public Function GetValue(Of T) As 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(Of 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
			Dim serializer As XmlObjectSerializer = New DataContractSerializer(GetType(Integer))
			Dim addressHeaderWithObjSer As AddressHeader = AddressHeader.CreateAddressHeader("MyServiceName", "http://localhost:8000/service", 1, serializer)
			Dim value As Integer = addressHeaderWithObjSer.GetValue(Of Integer)()


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft