Java Web 服务框架/库,哪个更好,为什么? [英] Java Web Service framework/library, which is a better one and why?

查看:24
本文介绍了Java Web 服务框架/库,哪个更好,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在评估 Java 中的 Web 服务框架的数量.我需要 Web 服务框架来帮助我公开在 JBoss 上运行的现有应用程序的一些功能,该应用程序主要使用 Spring 和 POJO(没有 EJB)开发.

Currently I am evaluating number of web service frameworks in Java. I need web service framework that will help me to expose some functionality of existent application running on JBoss, The application is mostly developed using Spring and POJOs (no EJBs).

我需要的是一个具有以下属性的框架:

What I need is a framework having following properties:

  1. 它应该提供自动生成样板代码的工具,并通过消除重复性任务来节省时间,例如从 Java 生成 WSDL 的工具 (java2wsdl)、生成端点的工具等.
  2. 应用程序应该很容易部署在现有的 J2EE 平台 (JBoss) 上,这意味着它应该包含尽可能少的配置文件(如axis2 框架中的axis2.xml).
    • 此外,最好能够在现有应用程序的 .war 存档中部署 Web 服务.(似乎 Axis2 需要一个单独的 Web 服务应用程序存档.)
    • 结合使用 POJOSpring 会很酷.
    • 通常,该框架应具有清晰的结构和设计(例如 Spring-WS 缺乏它)、良好的文档以及优秀软件的其他特征.
    • 框架最好包含一些标准功能,例如 JAX-WS 等,而不是特定于供应商的方法.
  1. It should provide tools for automatic generation of boilerplate code and save time by eliminating repetitive tasks, for example tools generating WSDL from Java (java2wsdl), tools generating endpoints etc.
  2. Applications should be easily deployed on existent J2EE platform (JBoss), this means that it should contain as less as possible configuration files (like axis2.xml in axis2 framework).
    • Also it is preferred to be able to deploy web service within .war archive of existent application. (it seems that Axis2 need a separate archive for web service app.)
    • It will be very cool to use a combination of POJOs and Spring.
    • Generally, the framework should have clean structure and design (for example Spring-WS lacks it), good documentation and whatever else characterizes a good piece of software.
    • It is preferred that framework incorporates some standard features like JAX-WS etc. instead of vendor specific methods.

我已经简要地检查过

  • 轴 2
  • Apache CXF
  • 和太阳的地铁
  • 弹簧 WS

但仍然很难决定在我的情况下使用什么:

But still it is difficult to decide what to use in my case:

  • Axis2 似乎非常低级,它需要单独的应用程序存档和大量配置
  • Spring WS 似乎太不透明并且为了印象目的而复杂(?)"
  • Apache CXF 和 Metro 可能是我更喜欢选择的两个框架,但仍然

我需要您对其中一些在实际应用程序中的使用提出意见和经验.

I need your opinion and experience about usage of some of them in a real-world applications.

推荐答案

我已经使用 CXF 的前身 XFire 有一段时间了,而且还不错.当时,我们从 Axis 迁移的主要原因有两个:性能和易于开发.当时(不知道现在是不是这样),XFire 的性能比其他任何东西都要好得多,而且通过注释驱动的开发,不必运行存根生成,添加新的真的很容易网络服务.

I've used CXF's forerunner, XFire, for a while now and it's not been too bad. At the time, we migrated from Axis for two major reasons: performance and ease of development. At the time (don't know if this is true now), the performance of XFire was much better than anything out there, and with annotation-driven development, instead of having to run stub generation, it was really really easy to add new web services.

CXF 似乎更相似但更好 - 由于开发时间的限制以及没有紧迫的理由,我们还没有迁移(加上 6-12 个月前相对缺乏文档是不太令人鼓舞).此外,我最近还没有真正评估过市场,所以我无法告诉您 CXF 如何与同时代的竞争对手抗衡.

CXF seems to be more of the same but better - we haven't migrated yet due to constraints on development time as well as not having a pressing reason to do so (plus the relative lack of documentation 6-12 months ago wasn't too encouraging). Additionally I haven't really evaluated the market of late, so I can't tell you how CXF stands up to its contemporary competitors.

关于你的观点:

  1. 没有要生成的样板代码,WSDL 是根据服务类的注释自动创建的,并由服务器发布.
  2. 在 Tomcat 中的部署相对简单.只需在 web.xml 中定义另一个 servlet 并将 URL 模式映射到该 servlet.
  3. 我们的网络服务部署在 WAR 文件中,我不确定实际上有哪些替代方案,但这似乎是默认且显而易见的方式.
  4. POJO 最初运行良好;我们现在已将大部分 Web 服务对象创建转移到 Spring 以连接更复杂的条件依赖项,并且没有遇到任何问题.
  5. 文档最初是 CXF 的一个弱点,尽管现在看起来更好了.总体设计和架构似乎比较理智;插入自己的过滤器来修改传输细节并不是很痛苦,并且通常会考虑扩展现有的类(例如,明智的方法被标记为受保护而不是私有).
  6. CXF 完全支持 JAX-WS.

所以我可能有点不偏不倚,因为我还没有尝试过其他的,但我会竖起大拇指看看 CXF.它非常快,使用起来相对简单,并且在您需要调整时相当强大.

So I'm probably a little impartial as I haven't tried the other ones, but I'll give a thumbs up to having a look at CXF. It's pretty fast, relatively simple to get going with and fairly powerful if you need to tweak it.

这篇关于Java Web 服务框架/库,哪个更好,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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