Share via


Invoking a Service from a DCS Workflow

A DCS service can act as a client application to another service. For example, you can create an operation in one service that invokes an operation in another service or another operation in the same service instance. To enable you to invoke DCS services from a DCS workflow, DCS provides the DcsProxy workflow activity.

The DcsProxy activity lets you invoke operations in a DCS service from another WF–based application. DcsProxy condenses everything that you defined in a code-based .NET application into a single activity that you can add to a workflow, in the same way that you add any other WF activity.

As with any other client application, the DcsProxy activity requires that you provide references to the assembly that contains the service proxy class and references to any message namespaces that are required by the operation that you want to invoke. For more information on DCS client requirements, see Assemblies Required by a Client Application. For more information on the DcsProxy activity, see The DcsProxy Activity.

Note

You do not need to add explicit references to the required DCS assemblies listed in the topic Assemblies Required by a Client Application. Visual Studio automatically adds these assemblies to the project when you add the DcsProxy activity to the workflow.

You must also provide configuration information to enable the workflow to invoke the Discovery Service. For more information about client application configuration, see Configuring a DCS Client Application.

The DcsProxy activity requires instances of the request and response messages for the operation that you intend to invoke, and it requires an instance of the Context class for communication. You use the BindProperty dialog box to create the required messages and Context class instance. Alternatively, you can write the code and add it to the workflow code-behind file before you configure the DcsProxy activity.

To configure the DcsProxy activity

  1. Implement a workflow to the point where you need to invoke the DCS service. Make sure that the workflow designer is open and displaying the workflow before you continue.

  2. Add references to your DCS service proxy and any message assemblies to the project. Also add a reference to System.Runtime.Serialization namespace if necessary.

  3. Open the Toolbox. In the DCS section, drag a DcsProxy activity into the required position on the workflow designer. Provide a name for the activity.

  4. In the DcsProxy activity properties, click InterfaceType, and then click the ellipsis (…) button.

  5. In the Browse and Select a .NET Type dialog box, select the Type tab. Under ReferencedAssemblies, select your proxy assembly.

  6. In the Type Name list, click the proxy class, and then click OK.

  7. In the DcsProxy activity properties, click MethodName, and then select the operation that you want to invoke from the list of available operations.

  8. Click the Request property.

  9. If you added the request message property manually, in the list of available properties, select the request property that you created.

  10. If you did not add the request message property manually:

    1. Double-click the Bind Property icon for the Request property.
    2. In the Bind 'request' to an activity's property dialog box, select the Bind to a new member tab. In the New membername box, type a name for the property, and then click OK.
  11. Visual Studio generates the required code in the workflow code-behind file.

  12. Repeat Step 8 for the Return and Context properties.

  13. Build the workflow.

See Also

Assemblies Required by a Client Application

The DcsProxy Activity.

Configuring a DCS Client Application