SendMessageContent Class

.NET Framework (current version)
 

A class used to send a single item (message) to or from a workflow service. The item can be a built-in type such as primitive types, Message, or XElement; or an application-defined data contract, message contract, or XML serializable type.

Namespace:   System.ServiceModel.Activities
Assembly:  System.ServiceModel.Activities (in System.ServiceModel.Activities.dll)

System.Object
  System.ServiceModel.Activities.SendContent
    System.ServiceModel.Activities.SendMessageContent

[ContentPropertyAttribute("Message")]
public sealed class SendMessageContent : SendContent

NameDescription
System_CAPS_pubmethodSendMessageContent()

Initializes a new instance of the SendMessageContent class.

System_CAPS_pubmethodSendMessageContent(InArgument)

Initializes a new instance of the SendMessageContent class with the specified data to send.

System_CAPS_pubmethodSendMessageContent(InArgument, Type)

Initializes a new instance of the SendMessageContent class with the specified message and message type.

NameDescription
System_CAPS_pubpropertyDeclaredMessageType

Gets or sets the declared message type.

System_CAPS_pubpropertyMessage

Gets or sets the data to send.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodShouldSerializeDeclaredMessageType()

Gets a value that indicates whether the DeclaredMessageType property should be XAML-serialized.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

When using this class, messages serialized on the wire are unwrapped, unless the data is a message contract type or of type Message.

The following example shows how to use a SendMessageContent instance with a Send activity.

Variable<PurchaseOrder> po = new Variable<PurchaseOrder>();
Variable<Customer> customer = new Variable<Customer>();

Endpoint clientEndpoint = new Endpoint
{
    Binding = Constants.Binding,
    AddressUri = new Uri(Constants.ServiceAddress)
};

Send submitPO = new Send
{
    Endpoint = clientEndpoint,
    ServiceContractName = Constants.POContractName,
    OperationName = Constants.SubmitPOName,
    Content = new SendMessageContent(new InArgument<PurchaseOrder>(po))               
};

.NET Framework
Available since 4.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: