WorkflowHostingResponseContext Klas

Definitie

Deze klasse wordt gebruikt in combinatie met de WorkflowHostingEndpoint klasse. Het wordt gebruikt voor het verzenden van het antwoord voor een aanvraag-/antwoordcontract dat wordt ondersteund door een WorkflowHostingEndpoint implementatie.

public ref class WorkflowHostingResponseContext sealed
public sealed class WorkflowHostingResponseContext
type WorkflowHostingResponseContext = class
Public NotInheritable Class WorkflowHostingResponseContext
Overname
WorkflowHostingResponseContext

Voorbeelden

In het volgende voorbeeld ziet u hoe een WorkflowHostingResponseContext wordt geleverd aan een eindpunt voor het hosten van een werkstroom.

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;
}

Methoden

Name Description
Equals(Object)

Bepaalt of het opgegeven object gelijk is aan het huidige object.

(Overgenomen van Object)
GetHashCode()

Fungeert als de standaardhashfunctie.

(Overgenomen van Object)
GetType()

Hiermee haalt u de Type huidige instantie op.

(Overgenomen van Object)
MemberwiseClone()

Hiermee maakt u een ondiepe kopie van de huidige Object.

(Overgenomen van Object)
SendResponse(Object, Object[])

Hiermee wordt een antwoord verzonden naar een bericht verzonden naar de WorkflowHostingEndpoint.

ToString()

Retourneert een tekenreeks die het huidige object vertegenwoordigt.

(Overgenomen van Object)

Van toepassing op