Windows > Software Development for Windows Client Forums > Windows Workflow Foundation > Hosting multiple workflows with WorkflowServiceHost
Ask a questionAsk a question
 

AnswerHosting multiple workflows with WorkflowServiceHost

  • Friday, October 05, 2007 5:17 PMPhilip Simons Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    Is it possible to host multiple workflows with WorkflowServiceHost ?

    If so how??

    I have a workflow of type Promis.Activities.LotModel that exposes ILotActions

    Now I want to add a workflow that exposes ILotStackActions:-

    WorkflowServiceHost wfh = new WorkflowServiceHost(typeof(Promis.Activities.LotModel));

    using (WorkflowRuntime runtime = wfh.Description.Behaviors.Find<WorkflowRuntimeBehavior>().WorkflowRuntime)

    {

    BasicHttpContextBinding contextbinding = new BasicHttpContextBinding();

    wfh.AddServiceEndpoint(typeof(ILotActions), contextbinding, "http://localhost:8080/LotActions");

    wfh.AddServiceEndpoint(typeof(ILotStackActions), contextbinding, "http://localhost:8080/LotStackActions");

Answers

All Replies

  • Friday, October 05, 2007 8:14 PMTom LakeMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    No, a WorkflowServiceHost can only host a single workflow.

     

  • Saturday, October 06, 2007 4:20 AMRoman KissMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Philip,

     

    - your example is OK, it's hosting one workflow with multiple endpoints. Note, that each service contract must have own ReceiveActivity (virtual WCF Service) in the same worfklow context.

     

    Thanks

     

    Roman