When you are using the brokered message in the Azure Service Bus, you can retrieve the body of the message with the call .GetBody. The code is simple:
var msg =
Here is the complete code to deserialize from the brokeredmessage:
public T GetBody(BrokeredMessage brokeredMessage)
{
var ct = brokeredMessage.ContentType;
Type bodyType = Type.GetType(ct, true);
var stream = brokeredMessage.GetBody();
DataContractSerializer serializer = new DataContractSerializer(bodyType);
XmlDictionaryReader reader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max);
object deserializedBody = serializer.ReadObject(reader);
T msgBase = (T)deserializedBody;
return msgBase;
}