Send 類別

定義

傳送訊息至服務的活動。

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 活動並將它加入至工作流程。 此範例也會示範如何使用 ReceiveReply 活動來接收回覆訊息。

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 類別的新執行個體。

屬性

Action

取得或設定所傳送訊息的動作標頭值。

CacheId

取得工作流程定義範圍內的唯一快取識別碼。

(繼承來源 Activity)
Constraints

取得 Constraint 活動的集合,這些活動可以設定為提供 Activity 的驗證。

(繼承來源 Activity)
Content

取得或設定 Send 活動所傳送的內容。

CorrelatesWith

取得或設定相互關聯控制代碼,此控制代碼會用於將訊息路由至適當的工作流程執行個體。

CorrelationInitializers

取得相互關聯初始設定式的集合。

DisplayName

取得或設定選擇性的易記名稱,這個名稱會用於偵錯、驗證、例外狀況處理及追蹤。

(繼承來源 Activity)
Endpoint

取得或設定傳送訊息的目的地端點。

EndpointAddress

取得或設定傳送訊息的目的地端點位址。

EndpointConfigurationName

取得或設定端點組態的名稱。

Id

取得工作流程定義範圍內的唯一識別碼。

(繼承來源 Activity)
Implementation

取得或設定委派,這個委派會傳回包含執行邏輯的 Activity

(繼承來源 Activity)
ImplementationVersion

取得或設定所使用實作的版本。

(繼承來源 Activity)
KnownTypes

取得要呼叫之服務作業之已知型別的集合。

OperationName

取得或設定要呼叫的服務作業名稱。

ProtectionLevel

取得或設定值,這個值表示該訊息的保護層級。

SerializerOption

取得或設定值,這個值會指定傳送訊息時所使用的序列化程式。

ServiceContractName

要呼叫之服務所實作的合約名稱。

TokenImpersonationLevel

取得或設定值,這個值會指出訊息接收器所允許的權杖模擬等級。

方法

CacheMetadata(ActivityMetadata)

建立並驗證活動引數、變數、子活動和活動委派的描述。

(繼承來源 Activity)
Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

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

建立動態更新對應時引發事件。

(繼承來源 Activity)
ShouldSerializeDisplayName()

指出是否應序列化 DisplayName 屬性。

(繼承來源 Activity)
ToString()

傳回包含 的 和 的 。

(繼承來源 Activity)

適用於