Search code examples
wcfmsmqworkflow-foundation

How do we initialize objects in Workflow (i.e. .xamlx)


My WCF service is suppose to push a call to MSMQ (queue), which eventually will call another WCF service to perform database operations. I have created a new project for MSMQ operations, and it has an "xamlx" file for the workflow. How do (or in which event) I initialize objects so that they can be accessible in the destination WCF?


Solution

  • hugh makes a great point. Based on what you've told us, it doesn't seem that workflow is absolutely necessary here.

    If it is needed for some other reason (e.g. flowing a distributed transaction), then in your workflow project, you should be able to do Add Service Reference to your destination WCF service. This will generate you activities that match the signature of your destination WCF service. The objects that those activities expect can be initialized via expressions, e.g. directly on the activity in the expression text box, or using a variable that is set via an Assign activity.

    Hope that helps,

    -- Dave, WF Team