Web Service Sample

Download sample

This sample demonstrates how to invoke Web services from a workflow and also how to publish a workflow as a Web service.

Specifically this sample demonstrates the use of the following activities:

The solution consists of three workflow projects. WebServicePublish and WebServicePublish_WebService are a workflow that is published as a Web service, and WebServiceInvoke is a sequential workflow that invokes the workflow that is published as a Web service.

Note

To publish a workflow as a Web service, right-click the project that contains the workflow and select Publish as a Web Service. The project must be a workflow project, and it must have at least one workflow that contains the WebServiceReceiveActivity and WebServiceOutputActivity activities.

The workflow that invokes the Web service sends a purchase order ID. The Web service prefixes the string "Approved" to the ID and sends it back as a response.

Note

To build and run the sample, you must install the ASP.NET 2.0 Development Server that is included with Visual Studio 2005 or Visual Web Developer 2005 Express Edition.

To build the sample

  1. Download the sample by clicking Download Sample in this topic.

    This extracts the sample project to your local hard disk.

  2. Click Start, point to Programs, point to Microsoft Windows SDK, and then click CMD Shell.

  3. Go to the source directory of the sample. At the command prompt, type MSBUILD <Solution file name>.

To run the sample

  1. In the SDK Command Prompt window, run the .exe file in the WebServiceInvoke\bin\debug folder (or the WebServiceInvoke\bin folder for the Visual Basic version of the sample), which is located below the main folder for the sample.

See Also

Reference

InvokeWebServiceActivity
WebServiceInputActivity
WebServiceOutputActivity
WorkflowWebService
WorkflowWebHostingModule

Other Resources

Using the WebServiceOutput Activity
Using the WebServiceFault Activity
Using the WebServiceInput Activity
Deploying a Workflow as a Web Service
Invoking Web Services from a Workflow
Communications Samples
Windows Workflow Foundation Samples

© 2007 Microsoft Corporation. All rights reserved.