如何优雅地处理 WWF 4 基于内容的关联中的“找不到实例”异常

发布于 2024-12-13 10:25:47 字数 528 浏览 4 评论 0原文

当 WWF 4 中使用基于内容的关联时,WWF 抛出 SOAP 错误异常的方式对于不使用 .NET 的 SOAP 客户端来说是有问题的。我有第 3 方客户正在连接到我的基于 WWF 4 的服务,并且他们没有很好地处理当他们使用的基于内容的关联 ID 无法与工作流实例关联或调用时引发的异常是在实例工作流程中的不正确时间进行的。

我正在尝试确定为那些连接到该服务的人提供的最佳方法。当然,一种是告诉他们捕获作为错误异常抛出的任何错误。然而,有些是通过现成的应用程序进行连接,这些应用程序旨在进行肥皂调用并响应返回的结果。由于它们没有优雅地处理错误异常,因此我正在考虑使用这些第三方客户端可以调用的 WCF 服务来包装 WWF 服务。在包装器服务中,我会将它们的调用转发到 WWF 服务并捕获任何相关异常并向客户端返回适当的肥皂响应,而不是让故障异常发送给客户端。

我讨厌添加这个额外的服务层,我想知道是否有人有任何建议或更好的方法? 有没有办法捕获 WWF 服务中的相关错误并向客户端返回格式正确的响应? 或者,相关错误是否发生在 WWF 的协议层中,而在工作流程中无法捕获?

The way that WWF throws a SOAP fault exception when content based correlation is used in WWF 4 proves problematic for SOAP clients that aren't using .NET. I have 3rd party clients who are connecting to my WWF 4 based services, and they aren't doing to well handling the exceptions that are thrown when the content based correlation id that they use fails to correlate with a workflow instance, or when the call is made at an improper time in the instance's workflow.

I am trying to determine the best approach to give those who are connecting to the service. One is, of course, to just tell them to catch any errors that are thrown as Fault Exceptions. However, some are connecting through off the shelf applications that are designed to make soap calls and respond to the results that are returned. Since they aren't elegantly handling the fault exceptions, I am considering wrapping the WWF service with a WCF service that these 3rd party clients can call. In the wrapper service, I will forward their call to the WWF service and catch any correlation exceptions and return to the client an appropriate soap response instead of letting the fault exception go to the client.

I hate adding this extra service layer, and I was wondering if anyone has any suggestions or a better approach?
Is there a way to catch the correlation error in the WWF service and return a well formed response to the client?
Or, does the correlation error happen in the protocol layer of WWF and there is no way to catch that in the workflow?

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

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

发布评论

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

评论(1

梦回梦里 2024-12-20 10:25:47

这些异常是由于 WCF/WF4 互操作基础结构无法确定将消息发送到的正确工作流实例而导致的。提到的 GUID 通常只是一个新的 GUID,这有点误导,因为它表明存在具有该 ID 的工作流实例。

该错误作为正常的 SOAP 错误返回,因此任何 SOAP 客户端都应该能够处理响应。能够用它做任何有用的事情是另一回事,这取决于客户端正在做什么以及发送的相关值来自哪里。

These exception are a result of the WCF/WF4 interop infrastructure not being able toe determine the correct workflow instance to send the message to. The GUID mentioned is usually just a new GUID which is a bit misleading as it suggest there is a workflow instance with that ID.

The error is returned as a normal SOAP fault so any SOAP client should be able to handle the response. And being able to do anything useful with it is another matter, that is up to what the client was doing and where the correlation values send came from.

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