Send 類別

定義

傳送訊息至服務的活動。An activity that sends a message to a service.

public ref class Send sealed : System::Activities::Activity
[System.Windows.Markup.ContentProperty("Content")]
public sealed class Send : System.Activities.Activity
[<System.Windows.Markup.ContentProperty("Content")>]
type Send = class
    inherit Activity
Public NotInheritable Class Send
Inherits Activity
繼承
屬性

範例

下列範例將示範如何建立 Send 活動並將它加入至工作流程。The following example shows how to create a Send activity and add it to a workflow. 此範例也會示範如何使用 ReceiveReply 活動來接收回覆訊息。The example also shows how to use ReceiveReply activity to receive the reply message.

Variable<string> message = new Variable<string>("message", "client");
Variable<string> result = new Variable<string> { Name = "result" };

Endpoint endpoint = new Endpoint
{
    AddressUri = new Uri(Common.Constants.ServiceBaseAddress),
    Binding = new BasicHttpBinding(),
};

Send requestEcho = new Send
{
    ServiceContractName = XName.Get("Echo", "http://tempuri.org/"),
    Endpoint = endpoint,
    OperationName = "Echo",
    Content = new SendParametersContent
    {
        Parameters =
            {
                { "message", new InArgument<string>(message) }
            }
    }
};
workflow = new CorrelationScope
{
    Body = new Sequence
    {
        Variables = { message, result },
        Activities =
        {
            new WriteLine {
                Text = new InArgument<string>("Hello")
            },
            requestEcho,
            new ReceiveReply
            {
                Request = requestEcho,
                Content = new ReceiveParametersContent
                {
                    Parameters =
                    {
                        { "echo", new OutArgument<string>(result) }
                    }
                }
            },
            new WriteLine {
                Text = new InArgument<string>(result)
            }
        }
    }
};

建構函式

Send()

初始化 Send 類別的新執行個體。Initializes a new instance of the Send class.

屬性

Action

取得或設定所傳送訊息的動作標頭值。Gets or sets the value of the action header of the message being sent.

CacheId

取得工作流程定義範圍內的唯一快取識別碼。Gets the identifier of the cache that is unique within the scope of the workflow definition.

(繼承來源 Activity)
Constraints

取得 Constraint 活動的集合,這些活動可以設定為提供 Activity 的驗證。Gets a collection of Constraint activities that can be configured to provide validation for the Activity.

(繼承來源 Activity)
Content

取得或設定 Send 活動所傳送的內容。Gets or sets the content sent by the Send activity.

CorrelatesWith

取得或設定相互關聯控制代碼,此控制代碼會用於將訊息路由至適當的工作流程執行個體。Gets or sets a correlation handle that is used to route the message to the appropriate workflow instance.

CorrelationInitializers

取得相互關聯初始設定式的集合。Gets a collection of correlation initializers.

DisplayName

取得或設定選擇性的易記名稱,這個名稱會用於偵錯、驗證、例外狀況處理及追蹤。Gets or sets an optional friendly name that is used for debugging, validation, exception handling, and tracking.

(繼承來源 Activity)
Endpoint

取得或設定傳送訊息的目的地端點。Gets or sets the endpoint to send messages to.

EndpointAddress

取得或設定傳送訊息的目的地端點位址。Gets or sets the address of the endpoint to send messages to.

EndpointConfigurationName

取得或設定端點組態的名稱。Gets or sets the name of the endpoint configuration.

Id

取得工作流程定義範圍內的唯一識別碼。Gets an identifier that is unique in the scope of the workflow definition.

(繼承來源 Activity)
Implementation

取得或設定委派,這個委派會傳回包含執行邏輯的 ActivityGets or sets the delegate that returns an Activity that contains the execution logic.

(繼承來源 Activity)
ImplementationVersion

取得或設定所使用實作的版本。Gets or sets the version of the implementation used.

(繼承來源 Activity)
KnownTypes

取得要呼叫之服務作業之已知型別的集合。Gets a collection of the known types for the service operation to be called.

OperationName

取得或設定要呼叫的服務作業名稱。Gets or sets the name of the service operation to be called.

ProtectionLevel

取得或設定值,這個值表示該訊息的保護層級。Gets or sets a value that indicates the protection level for the message.

SerializerOption

取得或設定值,這個值會指定傳送訊息時所使用的序列化程式。Gets or sets a value that specifies the serializer to use when sending a message.

ServiceContractName

要呼叫之服務所實作的合約名稱。The name of the contract the service to be called implements.

TokenImpersonationLevel

取得或設定值,這個值會指出訊息接收器所允許的權杖模擬等級。Gets or sets a value that indicates the token impersonation level allowed for the receiver of the message.

方法

CacheMetadata(ActivityMetadata)

建立並驗證活動引數、變數、子活動和活動委派的描述。Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates.

(繼承來源 Activity)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnCreateDynamicUpdateMap(UpdateMapMetadata, Activity)

建立動態更新對應時引發事件。Raises an event when creating dynamic update map.

(繼承來源 Activity)
ShouldSerializeDisplayName()

指出是否應序列化 DisplayName 屬性。Indicates whether the DisplayName property should be serialized.

(繼承來源 Activity)
ToString()

傳回包含 的 和 的 。Returns a String that contains the Id and DisplayName of the Activity.

(繼承來源 Activity)

適用於