阿帕奇 CXF |对 Web 服务调用的多个响应

发布于 2024-09-03 07:39:17 字数 107 浏览 0 评论 0原文

我们希望使用 CXF 实现一个 Web 服务,使得对其的调用是异步的并且服务器发回多个响应。 CXF 或任何其他 Web 服务 API 是否有办法做到这一点,或者我们是否需要为此编写自己的自定义实现?

We want to implement a webservice with CXF in such a way that the call to it is asynchronous and the server sends back multiple responses. Is there a way in CXF or any other webservice API to do this or do we need to write our own custom implementation for this?

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

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

发布评论

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

评论(2

小忆控 2024-09-10 07:39:17

这似乎是一个不寻常的要求。您能详细说明一下用例吗?可能有更合适的机制来完成响应传递。

That seems an unusual requirement. Could you elaborate on the use case? There may be a more appropriate mechanism to accomplish response delivery.

濫情▎り 2024-09-10 07:39:17

如果结果确实是异步的,并且您可以让客户端侦听传入消息,那么在每个方向上使用单向消息可能是最简单的方法。
但您可以尝试的一种替代方案是以 Atom 流的形式提供结果,这样您就可以花时间来生成结果。请注意,我还没有尝试过这一点;我刚刚在文档中看到了它的描述(当时不需要它)。您可能还需要改用 RESTful 交互风格才能实现这一点,但使用 CXF 就很容易做到这一点。

If the result is really asynchronous and you can have the client listen for incoming messages, it's perhaps easiest to just use one-way messages in each direction.
But one alternative you could try instead is to deliver the results as an Atom stream, which you can take your time over producing. Be aware that I have not tried that out; I've just seen it described in the documentation (and didn't need it at the time). You might also need to switch to using a RESTful interaction style to make that work, but that's pretty easy with CXF.

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