WorkflowHostingResponseContext クラス

定義

このクラスは、 WorkflowHostingEndpoint クラスと組み合わせて使用されます。 これは、 WorkflowHostingEndpoint 実装でサポートされている要求/応答コントラクトの応答を送信するために使用されます。

public ref class WorkflowHostingResponseContext sealed
public sealed class WorkflowHostingResponseContext
type WorkflowHostingResponseContext = class
Public NotInheritable Class WorkflowHostingResponseContext
継承
WorkflowHostingResponseContext

次の例は、ワークフロー ホスティング エンドポイントに WorkflowHostingResponseContext を提供する方法を示しています。

protected override WorkflowCreationContext OnGetCreationContext(object[] inputs, OperationContext operationContext, Guid instanceId, WorkflowHostingResponseContext responseContext)
{
    WorkflowCreationContext creationContext = new WorkflowCreationContext();
    if (operationContext.IncomingMessageHeaders.Action.EndsWith("Create"))
    {
        Dictionary<string, object> arguments = (Dictionary<string, object>)inputs[0];
        if (arguments != null && arguments.Count > 0)
        {
            foreach (KeyValuePair<string, object> pair in arguments)
            {
                //arguments to pass to the workflow
                creationContext.WorkflowArguments.Add(pair.Key, pair.Value);
            }
        }
        //reply to client with instanceId
        responseContext.SendResponse(instanceId, null);
    }
    else if (operationContext.IncomingMessageHeaders.Action.EndsWith("CreateWithInstanceId"))
    {
        Dictionary<string, object> arguments = (Dictionary<string, object>)inputs[0];
        if (arguments != null && arguments.Count > 0)
        {
            foreach (KeyValuePair<string, object> pair in arguments)
            {
                //arguments to pass to workflow
                creationContext.WorkflowArguments.Add(pair.Key, pair.Value);
            }
        }
    }
    else
    {
        throw new InvalidOperationException("Invalid Action: " + operationContext.IncomingMessageHeaders.Action);
    }
    return creationContext;
}

メソッド

名前 説明
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
SendResponse(Object, Object[])

WorkflowHostingEndpointに送信されたメッセージに応答を送信します。

ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象