SALES: 1-800-867-1380

BrokeredMessage.GetBody(Of T) Method

Deserializes the brokered message body into an object of the specified type by using the DataContractSerializer with a binary XmlDictionaryReader.

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

'Declaration
Public Function GetBody(Of T) As T
'Usage
Dim instance As BrokeredMessage 
Dim returnValue As T

returnValue = instance.GetBody()

Type Parameters

T

The type to which the message body will be deserialized.

Return Value

Type: T
The deserialized object or graph.

ExceptionCondition
ObjectDisposedException

If the message is in disposed state or the message body stream is already disposed.

InvalidOperationException

If the message contains a null body stream or the body stream contains no data or the message body has already been consumed.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft