WorkflowHostingResponseContext Class
This class is used in conjunction with the WorkflowHostingEndpoint class. It is used for sending the response for a request/reply contract supported by a WorkflowHostingEndpoint implementation.
Assembly: System.ServiceModel.Activities (in System.ServiceModel.Activities.dll)
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | SendResponse(Object^, array<Object^>^) | Sends response to a message sent to the WorkflowHostingEndpoint. |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
The following example illustrates how a WorkflowHostingResponseContext is provided to a workflow hosting endpoint.
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; }
Available since 4.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
