Receive Activity Designer
The Receive activity designer is used to create and configure a Receive activity. A Receive activity is an activity that receives a message that can be either a built-in type such as Message, Stream or XElement, or an application-defined data contract, message contract, or XML class that can be serialized.
The Receive Activity
The Receive activity can receive a single item or multiple items depending on the type of receive content used. A SendReply activity can be bound to a Receive activity that receives a message as part of a request/response message exchange pattern on the service.
Using the Receive Activity Designer
The Receive activity designer can be found in the Messaging category of the Toolbox, which is accessed by clicking the Toolbox tab on the Workflow Designer (Alternatively, select Toolbar from the View menu or CTRL+ALT+X.)
The Receive activity designer can be dragged from the Toolbox and dropped on to the Workflow Designer surface wherever activities are usually placed. This creates a Receive activity with a default DisplayName of Receive. The DisplayName can be edited in the header of the Receive activity designer or in the DisplayName box of the property grid.
To create a SendReply activity and bind it to the selected Receive activity, right-click the Receive activity designer, click the Create SendReply item in the context menu and the SendReplyToReceive designer appears below the Receive designer. The SendReply activity is an activity that sends the reply message as part of a request/response message exchange pattern on the service. It can be configured with the SendReplyToReceive designer.
Alternatively, the ReceiveAndSendReply template designer in the Messaging category of the Toolbox can be used to create a pair of pre-configured Receive and SendReply activity. For more information about the use of the ReceiveAndSendReply and SendReplyToReceive template, see the ReceiveAndSendReply Template Designer topic.
The Receive Activity Properties
The following table shows the Receive properties and describes how they are used in the designer. These properties can be edited in properties grid or on the Workflow Designer surface. The only required property is the OperationName property.
Property Name | Required | Usage |
---|---|---|
False |
Specifies the friendly name of the Receive activity. The default value is Receive. Although the use of a non-default value for the friendly DisplayName is not strictly required, it is a best practice to use such a value. |
|
True |
Specifies the name of the service operation implemented by this Receive activity. This property is used to construct the default value for the Action property if the Action property is not explicitly set. |
|
False |
Specifies the name of the service contract. This property is used to group service operations into individual service contracts. All Receive activities that have the same ServiceContractName are grouped into the same service contract (WSDL Port Type). The default value is the fully-qualified CLR name of the top level (root) activity. |
|
False |
Specifies the message or parameter content to receive. It can be either a ReceiveMessageContent activity or a ReceiveParametersContent activity. Edit this property by clicking the ellipse button beside the Content field in property grid or clicking the Defineā¦ button beside the Content label on the Receive activity designer surface. Both display the Content Definition dialog. For more information about how to use this box, see the Content Definition Dialog Box topic. |
|
False |
Specifies the correlations between Receive activities in service operations of a workflow with a MessageQuerySet object. Click the ellipsis button next to the CorrelatesOn property in the properties grid to open the CorrelatesOn Definition dialog box. For more information about the use of this dialog box, see the Content Definition Dialog Box topic. |
|
False |
Specifies the CorrelationHandle used to route the message to the appropriate workflow instance. Click the ellipsis button next to the CorrelatesWith property in the properties grid to open the Expression Editor dialog box. For more information about the use of this dialog box, see the How to: Use the Expression Editor topic. |
|
False |
Specifies the collection of CorrelationInitializer objects that initialize multiple CorrelationHandle objects that configure this Receive activity within the workflow. Click the ellipsis button next to the CorrelationInitializers property in the properties grid to open the Add Correlation Initializers dialog box. For more information about using this box, see the Add CorrelationInitializers Dialog Box topic. |
|
False |
Specifies a value that determines whether a new workflow instance is created to process the message if the message does not correlate to an existing workflow instance. If the value is set to true, a new workflow instance is created to process the message when the message is not correlated with an existing workflow instance. |
|
False |
Specifies a collection of known types for the service operation implemented by this Receive activity. This property should be used in conjunction with the SerializerOption property set to DataContractSerializer. It is ignored if XmlSerializer is used. Click the ellipse button beside the KnownTypes field in property grid to display the Type Collection Editor dialog box with which you can add relevant types. For more information about using this box, see the Type Collection Editor Dialog Box topic. |
|
False |
Specifies the ProtectionLevel for the message.
|
|
False |
Specifies the type of serializer to use for the service operation implemented by the Receive activity. The default value is DataContractSerializer, which serializes and deserializes an instance of a type into an XML stream or document that uses a supplied data contract. The XmlSerializer can also be used if more control is required over the XML. |
|
False |
Specifies the action header of the message. If it is not explicitly set, its value defaults to: |
See Also
Concepts
InitializeCorrelation Activity Designer
CorrelationScope Activity Designer
ReceiveAndSendReply Template Designer
Send Activity Designer
SendAndReceiveReply Template Designer
TransactedReceiveScope Activity Designer