WF4调用WCF服务

发布于 2024-12-26 02:20:52 字数 221 浏览 4 评论 0 原文

我在尝试获取工作流 (WF4) 来调用长时间运行的 WCF 服务,然后在 WCF 服务完成时恢复处理时遇到问题。下图给出了我想要实现的目标的粗略轮廓。如果您能给我指出任何演示这种情况(或非常类似的情况)的示例,我将不胜感激。作为信息,我见过很多 WF 到 WF 的例子,但并没有真正的帮助。

在此处输入图像描述

I'm having a problem trying to get a workflow (WF4) to call a long running WCF service and then resume processing when the WCF service completes. The diagram below gives a rough outline of what I'm trying to achieve. If you could point me at any samples that demonstrate this scenario (or something very similar) it would be greatly appreciated. For info, I've seen plenty WF to WF examples that didn't really help.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧人 2025-01-02 02:20:52

你考虑过相关性吗?这是 WF4 为您处理的吗?在 WF3 中,这并不是开箱即用的。这意味着,如果您从长时间运行的服务发送请求,WF3 将不知道将响应消息路由到工作流的哪个实例。

如果没有关联,来自 WCF 的回调将不会路由到“等待”工作流实例。

更新

您是否将相关令牌写入回调消息中?

更新

抱歉,我没有示例,因为我不是 WF4 用户。我必须在 WF3 中实现关联,因为它不提供该功能。为此,我创建了一个查找服务,它将相关值映射到工作流实例 guid,然后入站调用可以通过 wsHttpContextBinding 定位特定实例。

但 WF4 使您能够初始化并跟踪每个基于发送和接收的活动的相关性。您可以在此处阅读相关内容:

http://blogs.msdn.com/b/endpoint/archive/2010/01/04/what-sa-correlation-and-why-do-i-want-to-initialize-it。 aspx

http://msdn.microsoft.com/en-us/library/ee358755(VS.100).aspx

Have you considered correlation? Is this handled for you by WF4? in WF3 this was not offered out of the box. It meant that if you sent a request out of a long running service WF3 would have no idea which instance of the workflow to route response messages to.

Without correlation the callback from WCF will not be routed to the "waiting" workflow instance.

UPDATE

Are you writing the correlation token into the callback message?

UPDATE

Sorry I don't have examples as I am not a WF4 user. I had to implement correlation into WF3 because it did not offer the feature. To do this I created a look up service which mapped correlation values to workflow instance guids, and inbound calls could then target specific instances via the wsHttpContextBinding.

But WF4 enables you to initialize and follow correlation on every send and receive-based activity. You can read about this here:

http://blogs.msdn.com/b/endpoint/archive/2010/01/04/what-s-a-correlation-and-why-do-i-want-to-initialize-it.aspx

http://msdn.microsoft.com/en-us/library/ee358755(VS.100).aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文