您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

BrokeredMessage Constructors

Definition

Overloads

BrokeredMessage()

Initializes a new instance of the BrokeredMessage class.

BrokeredMessage(Stream)

Initializes a new instance of the BrokeredMessage class.

BrokeredMessage(Object)

Initializes a new instance of the BrokeredMessage class from a given object by using DataContractSerializer with a binary XmlDictionaryWriter.

BrokeredMessage(Stream, Boolean)

Initializes a new instance of the BrokeredMessage class using the supplied stream as its body.

BrokeredMessage(Object, XmlObjectSerializer)

Constructor that creates a BrokeredMessage from a given object using the provided XmlObjectSerializer

BrokeredMessage()

Initializes a new instance of the BrokeredMessage class.

public BrokeredMessage ();

BrokeredMessage(Stream)

Initializes a new instance of the BrokeredMessage class.

public BrokeredMessage (System.IO.Stream messageBodyStream);
Parameters
messageBodyStream
Stream

The message body stream.

BrokeredMessage(Object)

Initializes a new instance of the BrokeredMessage class from a given object by using DataContractSerializer with a binary XmlDictionaryWriter.

public BrokeredMessage (object serializableObject);
Parameters
serializableObject
Object

The object to be serialized into the message body.

Remarks

A default Microsoft.ServiceBus.Messaging.DataContractBinarySerializer is used for serializing the object.

BrokeredMessage(Stream, Boolean)

Initializes a new instance of the BrokeredMessage class using the supplied stream as its body.

public BrokeredMessage (System.IO.Stream messageBodyStream, bool ownsStream);
Parameters
messageBodyStream
Stream

The message body stream.

ownsStream
Boolean

true to indicate that the stream will be closed when the message is closed; false to indicate that the stream will not be closed when the message is closed.

BrokeredMessage(Object, XmlObjectSerializer)

Constructor that creates a BrokeredMessage from a given object using the provided XmlObjectSerializer

public BrokeredMessage (object serializableObject, System.Runtime.Serialization.XmlObjectSerializer serializer);
Parameters
serializableObject
Object

The serializable object.

serializer
XmlObjectSerializer

The serializer object.

Exceptions

Thrown when null serializer is passed to the method with a non-null serializableObject

Remarks

You should be aware of the exceptions that their provided Serializer can throw and take appropriate actions. Please refer to for a possible list of exceptions and their cause.

Applies to