WorkflowHostingResponseContext Klasse
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Diese Klasse wird in Verbindung mit der WorkflowHostingEndpoint Klasse verwendet. Sie wird zum Senden der Antwort für einen Anforderungs-/Antwort-Vertrag verwendet, der von einer WorkflowHostingEndpoint Implementierung unterstützt wird.
public ref class WorkflowHostingResponseContext sealed
public sealed class WorkflowHostingResponseContext
type WorkflowHostingResponseContext = class
Public NotInheritable Class WorkflowHostingResponseContext
- Vererbung
-
WorkflowHostingResponseContext
Beispiele
Im folgenden Beispiel wird veranschaulicht, wie ein Workflowhostingendpunkt bereitgestellt WorkflowHostingResponseContext wird.
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 | Beschreibung |
|---|---|
| Equals(Object) |
Bestimmt, ob das angegebene Objekt dem aktuellen Objekt entspricht. (Geerbt von Object) |
| GetHashCode() |
Dient als Standardhashfunktion. (Geerbt von Object) |
| GetType() |
Ruft die Type der aktuellen Instanz ab. (Geerbt von Object) |
| MemberwiseClone() |
Erstellt eine flache Kopie der aktuellen Object. (Geerbt von Object) |
| SendResponse(Object, Object[]) |
Sendet die Antwort auf eine nachricht, die an die WorkflowHostingEndpoint. |
| ToString() |
Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. (Geerbt von Object) |