Workflow as Web Service
Sometimes you may need to expose the workflow as a web service. So, let’s take a look on how you can create a simple workflow and expose it as a web service
We can divide the task into two.
1. Creating a workflow compitable with webservice.
2. Expose it as a webservice.
We need three activity for this project
WebServiceInput, WebServiceOutput & WebServiceFault.
Create a
Sequential Workflow Library project
1. Drag a
WebServiceInput on workflow
We need to create an interface which will act as the contract for our operation
namespace Arindam.WWF
{
[ServiceContract]
public interface IService
{
[OperationContract]
string GetEmployee(int EmpID);
}
}
2. Then drag a ifelseActivity condition block on workflow.
In left side of ifelse drag a codeactivity (name as per your bisiness object).
Then drag a WebServiceOutput activity just below that.
3.
WebServiceFault is the exception thrown by service object .
4. Finally
Publish, right click on project and click publish as webservice.
Click here to download code sample