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 ();
Public Sub New ()

BrokeredMessage(Stream)

Initializes a new instance of the BrokeredMessage class.

public BrokeredMessage (System.IO.Stream messageBodyStream);
new Microsoft.ServiceBus.Messaging.BrokeredMessage : System.IO.Stream -> Microsoft.ServiceBus.Messaging.BrokeredMessage
Public Sub New (messageBodyStream As Stream)

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);
new Microsoft.ServiceBus.Messaging.BrokeredMessage : obj -> Microsoft.ServiceBus.Messaging.BrokeredMessage
Public Sub New (serializableObject As Object)

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);
new Microsoft.ServiceBus.Messaging.BrokeredMessage : System.IO.Stream * bool -> Microsoft.ServiceBus.Messaging.BrokeredMessage
Public Sub New (messageBodyStream As Stream, ownsStream As Boolean)

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);
new Microsoft.ServiceBus.Messaging.BrokeredMessage : obj * System.Runtime.Serialization.XmlObjectSerializer -> Microsoft.ServiceBus.Messaging.BrokeredMessage
Public Sub New (serializableObject As Object, serializer As XmlObjectSerializer)

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