RESTful Workflow Service Endpoints in WF4 / WCF

Folks, I am creating a fairly standard workflow that I want to open through the WCF endpoint. I am using the WCF Service Application project template and I have a .xamlx service. This is a very simple document exchange workflow service - I want POST users to use me blob XML as the body of an HTTP message (with HTTP headers containing authentication tokens). In response, these consumers will receive a blob XML containing the response. The 2 goals for me using REST / POX here are the nature of the interaction with the documents / message. I want to simplify client development for non-NET environments (especially in environments such as Silverlight and iPhone).

I really don’t see how to make this possible using functions from the window (unless I am missing something). Does anyone know how to create a RESTful endpoint (or even REST-ish, I'm not picky) for a WF4 workflow? Any information leading in the right direction would be great.

+7
workflow wcf workflow-foundation workflow-foundation-4
source share
2 answers

There are no actions that allow you to use REST with WF, Receice is pure SOAP.

You can either create a custom REST Receive activity, or use it in your workflow. Depending on your needs, this will be quite a lot for a lot of work. An easy option is to use the standard WCF REST endpoint and convert the REST data to SOAP, send a request to the workflow, and do the opposite as a result of the message.

+1
source share

This document has an unreleased item in CodePlex that includes source code. Also see this SO answer for another idea to achieve this.

If you want to see the CodePlex action released, please release the UserVoice request .

Using the REST Pass-Through Service

As @Maurice mentions, you can also treat the WF service as an internal service and expose a REST service that simply calls the WF service.

This method is a bit clumsy, but has the advantage that it does not use anything unreleased or really complicated.

If the back-end service runs on the same machine as the REST service (which is likely to do just that), you should open the WF service by using named pipe bindings. This binding is fast, but only works when the caller and the callee are in the same window.

Another thought: your REST end-to-end service is blocked during a call to the back-end service. If your WF service does not work very fast, it is beneficial for you to make the REST service asynchronous so that it doesn’t block the thread pool thread when the WF service is called.

+2
source share

All Articles