RESTful Workflow Service Endpoints in WF4 / WCF

别来无恙 提交于 2019-11-29 07:04:43

There are no out of the box activities that will allow you to use REST with WF, the Receice is pure SOAP.

You can either build a custom REST Receive activity and use that with your workflow. Depending on your needs this is going to be quite a handful to a lot of work. The easy option is use use a standard REST WCF endpoint and convert the REST data to SOAP, pass rhe request on to the workflow, and do the reverse on the result message.

Olly

There is an unreleased item on CodePlex to cover this, which includes source code. Also see this SO answer which contains another idea for achieving this.

If you'd like to see the CodePlex activity released, please up-vote the UserVoice request.

Using a REST Pass-Through Service

As @Maurice mentions, you can also treat the WF service as a back-end service and expose a REST service that simply calls through to the WF service.

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

If the back-end service runs on the same machine as the REST service (which is probably what you'd do), you should expose the WF service using the named pipes binding. This binding is fast, but only works when the caller and callee are on the same box.

A further thought: your REST pass-through service is blocked while the back-end service is being called. If your WF service is not very fast, you'd benefit from making your REST service asynchronous so it doesn't block a thread pool thread while the WF service is being called.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!