WF4/WCF 中的 RESTful 工作流服务端点 [英] RESTful Workflow Service Endpoints in WF4 / WCF

查看:28
本文介绍了WF4/WCF 中的 RESTful 工作流服务端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位,我正在构建一个非常标准的工作流,我想通过 WCF 端点公开它 - 我正在使用WCF 服务应用程序"项目模板,并且我有一个 .xamlx 服务.这是一个非常简单的文档交换工作流服务 - 我希望消费者向我发送一个 XML blob 作为 HTTP 帖子的正文(带有包含身份验证令牌的 HTTP 标头).作为响应,这些消费者将获得包含回复的 XML 块.我在这里使用 REST/POX 的 2 个目标是交互的基于文档/消息的性质,我想让非 .NET 环境(尤其是 Silverlight 和 iPhone 等有限环境)的客户端开发变得容易.

Folks, I'm building a pretty standard workflow that I want exposed via a WCF endpoint - I'm using the "WCF Service Application" project template and I've got a .xamlx service. This is a very simple document interchange workflow service - I want consumers to POST me a blob of XML as the body of an HTTP post (with HTTP headers containing authentication tokens). In response, these consumers will get a blob of XML containing the reply. 2 goals for me using REST/POX here are the document/message-based nature of the interaction AND I want to make client development easy for non-.NET environments (especially limited environments like Silverlight and iPhone).

我真的不知道如何使用开箱即用的功能来实现这一点(除非我遗漏了一些东西).有人知道如何为 WF4 服务托管的工作流创建 RESTful(甚至是 REST-ish,我不挑剔)端点吗?任何指向正确方向的信息都会很棒.

I don't really see how to make this possible using out of the box features (unless I'm missing something). Does anybody know how to create a RESTful (or even REST-ish, I'm not picky) endpoint for a WF4 service-hosted workflow? Any info leading in the right direction here would be great.

推荐答案

没有开箱即用的活动可以让您将 REST 与 WF 结合使用,Receice 是纯 SOAP.

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

您可以构建自定义 REST 接收活动并将其用于您的工作流程.根据您的需要,这将是很多工作的一部分.简单的选择是使用标准的 REST WCF 端点并将 REST 数据转换为 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.

这篇关于WF4/WCF 中的 RESTful 工作流服务端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆