Axis与CXF比较

新一代的 Web Services 框架如 Axis2、CXF 都是由现有的项目中逐渐演化而来的,Axis2 是由大家熟悉的 Axis 1.x 系列演化过来,而 Apache CXF 则是由 Celtix 和 XFire 项目整合而生,并且刚刚发布了 2.0.2 的最新版本,不过仍是 Apache 的一个孵化项目。

Axis2 是对 Axis 进行了彻底的重写的一个新项目了,它使用了新的模块化架构,更方便于功能性的扩展等等。
Apache CXF 则是由 XFire 和 Celtix 两个现有的项目进行了重组。

问题:如果现有的应用程序是基于 Axis 1.x、XFire 或者 Celtix 的话,那应该怎么办?都迁移到这些新的框架上去吗?但是即使是要迁移,那应该迁移到哪个框架上去呢?
如果是编写一个新的 Web Services 应用程序的话,就不存在迁移的问题了,但是哪个框架是你应当选择进行使用的呢?哪个比哪个更好呢?

对于现在的应用程序的迁移,如果你的应用程序是稳定而成熟的,并且在可预知的未来的情况下,只要很少的一些需求变更要做的话,那么保存你的体力,不要去做“劳民伤财“的迁移工作了。
如果你的现有应用程序BUG缠身,性能,功能等等都一片糟糕的话,那就要考虑迁移了,那选哪个框架呢?先比较一下它们的不同之处:

  1、Apache CXF 支持 WS-Addressing、WS-Policy、WS-RM、WS-Security和WS-I BasicProfile
  2、Axis2 支持 WS-Addressing、WS-RM、WS-Security和WS-I BasicProfile,WS-Policy将在新版本里得到支持
  3、Apache CXF 是根据Spring哲学来进行编写的,即可以无缝地与Spring进行整合
  4、Axis2 不是
  5、Axis2 支持更多的 data bindings,包括 XMLBeans、JiBX、JaxMe 和 JaxBRI,以及它原生的 data binding(ADB)。
  6、Apache CXF 目前仅支持 JAXB 和 Aegis,并且默认是 JAXB 2.0,与 XFire 默认是支持 Aegis 不同,XMLBeans、JiBX 和 Castor 将在 CXF 2.1 版本中得到支持,目前版本是 2.0.2
  7、Axis2 支持多种语言,它有 C/C++ 版本。
  8、Apache CXF 提供方便的Spring整合方法,可以通过注解、Spring标签式配置来暴露Web Services和消费Web Services

如何抉择:
1、如果应用程序需要多语言的支持,Axis2 应当是首选了;
2、如果应用程序是遵循 Spring 哲学路线的话,Apache CXF 是一种更好的选择,特别对嵌入式的 Web Services 来说;
3、如果应用程序没有新的特性需要的话,就仍是用原来项目所用的框架,比如 Axis1,XFire,Celtrix 或 BEA 等等厂家自己的 Web Services 实现,就别劳民伤财了。


CXF:

Support for Standards
JSR Support
•JAX-WS - Java API for XML-Based Web Services (JAX-WS) 2.0 - JSR-224
•Web Services Metadata for the Java Platform - JSR-181
•JAX-RS - The Java API for RESTful Web Services - JSR-311
•SAAJ - SOAP with Attachments API for Java (SAAJ) - JSR-67
WS-* and related Specifications Support
•Basic support: WS-I Basic Profile 1.1
•Quality of Service: WS-Reliable Messaging
•Metadata: WS-Policy, WSDL 1.1 - Web Service Definition Language
•Communication Security: WS-Security, WS-SecurityPolicy, WS-SecureConversation, WS-Trust (partial support)
•Messaging Support: WS-Addressing, SOAP 1.1, SOAP 1.2, Message Transmission Optimization Mechanism (MTOM)
Multiple Transports, Protocol Bindings, Data Bindings, and Formats
•Transports: HTTP, Servlet, JMS, In-VM and many others via the Camel transport for CXF such as SMTP/POP3, TCP and Jabber
•Protocol Bindings: SOAP, REST/HTTP, pure XML
•Data bindings: JAXB 2.x, Aegis, Apache XMLBeans, Service Data Objects (SDO), JiBX
•Formats: XML Textual, JSON, FastInfoset
•Extensibility API allows additional bindings for CXF, enabling additional message format support such as CORBA/IIOP
Flexible Deployment
•Lightweight containers: deploy services in Jetty, Tomcat or Spring-based containers
•JBI integration: deploy as a service engine in a JBI container such as ServiceMix, OpenESB or Petals
•Java EE integration: deploy services in Java EE application servers such as Apache Geronimo, JOnAS, Redhat JBoss, OC4J, Oracle WebLogic, and IBM WebSphere
•Standalone Java client/server
Support for Multiple Programming Languages
•Full support for JAX-WS 2.x client/server programming model
•JAX-WS 2.x synchronous, asynchronous and one-way API's
•JAX-WS 2.x Dynamic Invocation Interface (DII) API
•JAX-RS for RESTful clients
•Support for wrapped and non-wrapped styles
•XML messaging API
•Support for JavaScript and ECMAScript 4 XML (E4X) - both client and server
•Support for CORBA
•Support for JBI with ServiceMix
Tooling
•Generating Code: WSDL to Java, WSDL to JavaScript, Java to JavaScript
•Generating WSDL: Java to WSDL, XSD to WSDL, IDL to WSDL, WSDL to XML
•Adding Endpoints: WSDL to SOAP, WSDL to CORBA, WSDL to service
•Generating Support Files: WSDL to IDL
•Validating Files: WSDL Validation


AXIS2:

Programming Model•Improved, XML-centric client API including full WSDL and policy support
•Support for JAXWS-style services and clients
•Support for POJO and Spring services and clients
•Support for any message exchange pattern
•Synchronous and asynchronous calls
•Archived service deployment model supporting full service encapsulation with versioning support
•Archived module deployment model supporting controlled extensibility with versioning support
•Hot deployment
•WS-Policy driven code generation extensions
•Flexible service life cycle model
•Automatic support for POX (REST) style invocation of services
•Support for querying a service's WSDL (using ?wsdl), schema (using ?xsd) and policies (using ?policy)
•WSDL 2.0
•Custom Deployers
•Binary serialization (Fast Infoset)
•JSON support
•EJB Provider support
Supported Specifications•SOAP 1.1 and 1.2
•Message Transmission Optimization Mechanism (MTOM), XML Optimized Packaging (XOP) and SOAP with Attachments
•WSDL 1.1, including both SOAP and HTTP bindings
•WS-Addressing (submission and final)
•WS-Policy
•SAAJ 1.1
Transports•HTTP
•SMTP
•JMS
•TCP
Supported Data Bindings•Axis Data Binding (ADB)
•XMLBeans
•JibX
•JaxBRI (Experimental)
Tools Included in This Release[Download Tool Plug-ins]

1.Axis2 Web Application (Web App)
2.WSDL2WS- eclipse plug-in/ Command line version/IntelliJ IDEA plug-in/Maven2 WSDL2Code Plug-in
3.Service Archive Wizard- eclipse plug-in/ IntelliJ IDEA plug-in/ Maven2 AAR Plug-in
4.Java2WSDL- Maven2 Java2WSDL Plug-in
Extension Modules•Apache Rampart: Supporting WS-Security (and soon WS-Policy)
•Apache Sandesha2: Supporting WS-Reliable Messaging
(Apache Axis2 comes built in with a module that supports WS-Addressing.)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值