Genpact Cora Knowledge Center


Invoke a WCF Service Activity

Use the API to invoke a WCF Service Activity.

This activity can be placed anywhere in the flow, and consumes any external service that is a WCF (Windows Communication Foundation) service.

object InvokeMethod(Guid workflowId, Guid activityId)
            IWorkflowEngine engine = WorkflowRuntime.Engine;
            AuthenticatedUser user = engine.GetCurrentUser();
            if (user != null)
                WcfServiceConsumerActivity activity = (WcfServiceConsumerActivity)engine.GetService<IWorkflowDefinitionService>()
                MethodDefinition method = activity.Method;
                return method.CreateInstance(new HttpContextWrapper(HttpContext.Current));;
                return null;