创建协议适配器的反馈/模式

发布于 2024-10-30 05:35:03 字数 259 浏览 6 评论 0原文

我有一个当前返回域对象的后端系统。我想建立一个 REST &使用 mule 的 SOAP 前端。为了创建基于 REST 或 SOAP 的响应,并确保后端与协议无关,我正在考虑创建两个协议适配器(REST 和 SOAP)。我不清楚是否为服务创建一个 mule 翻译器更好,它理解协议并委托生成适当的响应,或者只是为服务创建两个类接口(使用 JAX-RS/JAX-WS 注释) 。

我没有找到太多关于该主题的文献、最佳实践或设计模式。有人可以向我指出一些有用的材料或提供他们的意见吗?

I have a backend system that currently returns a domain object. I want to build a REST & SOAP front end using mule. To create responses that are REST or SOAP based, and ensure that the backend is protocol agnostic, I am thinking about creating two protocol adapters (REST and SOAP). It is unclear to me if it is better to create a mule translator for the service, which understands the protocol and delegates to generate an appropriate response, or just create two class interfaces (using JAX-RS/JAX-WS annotations) to the service.

I'm not finding much literature, best practices, or design patterns on the subject. Can someone point me to some useful material or provide their opinions?

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

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

发布评论

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

评论(1

め可乐爱微笑 2024-11-06 05:35:03

编写用于消息格式化的转换器是浪费时间。

您应该使用 JAX-RS/JAX-WS 注释编写服务类,两者都存在传输。

对于 REST 服务,您可以使用 Jersey 传输:
http://www.mulesoft.org/documentation/display/JERSEY/User 's+Guide

对于 SOAP 服务,您可以使用 CXF 传输(也支持 JAX-RS):
http://www.mulesoft.org/documentation/display/CXF /Building+a+web+service

注意:您根本不需要 mule,Jersey 和 CXF 都运行在像 tomcat 这样的 servlet 容器中。

Writing transformers for message formatting would be a waste of time.

You should write service classes with JAX-RS/JAX-WS annotations, transports exist for both.

For a REST service you can use the Jersey transport:
http://www.mulesoft.org/documentation/display/JERSEY/User's+Guide

For SOAP service you can use the CXF transport (also supports JAX-RS):
http://www.mulesoft.org/documentation/display/CXF/Building+a+web+service

Note: You don't need mule for this at all, both Jersey and CXF run in a servlet container like tomcat.

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