Difference between Axis2 webservice and CXF web service - web-services

I would be grateful if any one help me to understand the difference between axis2 web service and CXF web service.

The main differences between axis2 web service and CXF web service are as follows:
CXF has support for WS-Addressing, WS-Policy, WS-RM, WS-Security,
and WS-I BasicProfile. Axis2 supports each of these except for
WS-Policy, which will be supported in an upcoming version.
CXF was written with Spring in mind; Axis2 is not.
Axis2 supports a wider range of data bindings, including XMLBeans,
JiBX, JaxMe and JaxBRI as well as its own native data binding, ADB.
Note that support for JaxME and JaxBRI are still considered
experimental in Axis2 1.2. CXF currently supports only JAXB and
Aegis; support for XMLBeans, JiBX and Castor will come in CXF 2.1.
Axis2 supports multiple languages--there is a C/C++ version
available in addition to the Java version.
In comparing these frameworks, though, it's just as important to look at their approach to developing web services as it is to compare features. From a developer perspective, both frameworks behave very differently from one another. Axis2 has taken an approach that makes it in many ways resemble an application server in miniature. Axis2 comes packaged with a WAR that can be deployed on a servlet container such as Tomcat that is designed to make web services easier to manage and deploy on the fly. The Axis2 Web Administration module allows Axis2 to be configured dynamically while applications are running--new services can be uploaded, activated or deactivated and their parameters may be changed. The administration UI also allows modules to be enabled on one or more running services. The only downside to using the UI for these purposes is the fact that configuration changes made through it are not persistent--they go away when the servlet container is restarted.
Axis2 lends itself towards web services that stand alone, independent of other applications, and offers a wide variety of functionality, and a good model for adding more functionality as time goes on through its modular architecture. Some developers may find that a little too cumbersome or heavy-duty for their needs. These developers might prefer to look at Apache CXF.
CXF concentrates on developer ergonomics and embeddability. Most configuration is done via the API instead of cumbersome XML files, Spring integration is heavily emphasized, including support for Spring 2.0, and CXF's APIs and Spring configuration mirror one another fairly closely. CXF emphasizes code-first design, using simple APIs to make development of services from existing applications easier (and its embeddability helps too).
Whichever framework you choose, you'll have the benefit of an active and stable open source community. Each of these frameworks has corporate backing: Axis2 is backed by WSO2, and CXF by Iona. Both have lively developer communities. Axis2 has been around longer but CXF is catching up quickly. My recommendation is this: If multilanguage support is important, Axis2 is the clear choice. If you care about an implementation focused on Java with tight integration into projects like Spring, CXF is a better choice, particularly for embedding web services inside of other programs. If the new features in these projects are not important, and you're relatively happy with Axis1, you should consider staying on this and keep up with the latest maintenance releases until you have a business reason to migrate.

Related

What framwework to use for SOAP if using Websphere Application Server

I have been going over the list of frameworks available for SOAP. My application is Spring MVC pattern and its deployed on Websphere servers. Do I still need to use framworks like Axis 2 or CXF? Can I just Use spring?
As Gas pointed out WebSphere provides support for JAX-WS (i.e. Java API for XML Web Services) since WAS 7.0. Additionally IBM provided Feature Pack for Web Services for WebSphere Application Server V6.1 that supported JAX-WS.
Even earlier versions of WAS supported JAX-RPC (since J2EE 1.4) but I do not recommend JAX-RPC approach because it was cumbersome and I don't think anyone is still using it. It is in fact deprecated since JEE 6.
So you do not need to use external libraries. Using standard JAX-WS implementation from WebSphere gives you possibility to easily configure services from administration console. This is especially nice when you integrate with other IBM WebSphere products or use some IBM standards like LTPA tokens. However, this implementation does not integrate with Spring.
You also might use external libraries, like Axis 2, Apache CXF or Metro. These also have some advantages. For instance Apache CXF integrates really nice with Spring and supports many standards. Spring WS is on the other hand minimalistic.
However, with these libraries you must expect some problems with class conflicts as they require often different versions of libraries than WebSphere provides. This might require you to change default classloading policy or other tweaks. It is possible to deal with but it is not for free.

Why Apache CXF?

I am a new to Java EE Services. In my project they will be using JAX-WS with Apache CXF. I want to know what is Apache CXF? I can use plain JAX-WS to create Web Services. Why should I use Apache CXF?
Apache CXF is just one of the implementations of JAX-WS API. There are other implementations, such as JAX-WS RI (reference implementation) that is included in Java and part of Metro framework (which includes some other things also, like WSIT).
Your question is - what are the reasons to choose Apache CXF? There are plenty of them, for example:
support for RESTful services (becoming more and more popular)
easy integration with Spring (if that matters to you)
WS-* support (i.e., support for many important WS-specifications like WS-Security)
maturity (thanks #sourcedelica)
References:
Why CXF?

Webservices for Spring 2.5.5

I have web application designed using spring 2.5.5 MVC, JBoss server. I want to expose my spring services (like add/update User, comments, documents, etc.) using WebService for EAI. Requirement is like any third-party application should be able to perform operations in my web application after authentication/authorization.
I have novice knowledge of SOAP (Axis2) and REST (Jersey), however i am not sure which will be best suited for my application.
Cheers
We are using Spring 3.0 actually. But former using Axis2 with Spring 2.5.x.
You might review our stack at http://incubator.apache.org/openmeetings the axis.
We simply integrated the regular Axis2 configuration into the web.xml and build a Facade to load the spring beans into the Axis enables Web-Service and forward the calls to the Spring enabled context that way.
Comparable to https://svn.apache.org/repos/asf/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/axis/services/FileWebServiceFacade.java
It is not the perfect solution, the Axis2 documentation also contains other ways to load the Spring context in the Web-Service enabled class, however it was never possible to make that work stable so we decided for this workaround.

why should i use axis 2 for jax-ws 2 compliant web service development

based on this link http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html
I assume that axis 2 provides FULL support for JAX-WS 2 compliant web service development.
My question is why should i use Axis-2 as web services runtime instead of using my app server's (like websphere's) inbuilt support for JAX-WS web services development.
Are there any special reasons for using AXIS 2 like runtimes. My assumption is they are provided as embeddable web services runtime implementations that can be used with tomcat / resin etc. which do not provide out of box web services support. And that they are not required to be used with app servers like websphere or weblogic which already provide support for full jax-ws 2 compliant web service development out of the box.
please confirm.
I'd definitely recommend using what WebSphere or any other server provides out-of-the-box whenever possible. You'll know it's tested and supported.
Somebody who really knows Axis2 may have reasons to prefer the 3rd-party version of it (WebSphere's JAX-WS support is actually based on Axis2), but I can't speak to that.

Approaches for creating REST Web services?

i am new to REST Service development. I compared the development mechanism for both REST and WS web services and i found that you can create a WS web service using WSDL file that is the top down appraoch (Correct me if i am wrong) and using bottom up approach also, that is generating the classes manually.
But when it comes to REST web service development you have to follow bottom up approach only that is generating the classes manually. NetBeans IDE provides certain wizards for creating REST web service quickly from databases, entity classes and patterns.
I had also seen when you are developing web service in eclipse and you are using wizard in eclipse IDE, you can create a REST web service from WSDL file. I found this very strange. My question here is what are the approaches we can have for creating REST web services. Can we create REST web services using top-down and bottom up approached. If yes then please provide me details.
Thanks.
It is possible to describe a REST service using a contract. This is the intent of WADL and WSDL 2.0. WADL is specifically a REST contract, whereas WSDL 2.0 evolved from the original WSDL spec. to support all HTTP bindings. Since REST services rely on the use of HTTP methods and headers to exchange messages a WSDL 2.0 contract can work. There is a really good explanation here: http://ajaxonomy.com/2008/xml/web-services-part-2-wsdl-and-wadl
For development of REST services, I'm not sure if NetBeans, Eclipse or other tools specifically support automated REST service from WSDL generation. I would imagine that most are still intended for SOAP service creation. At this point I think WSDL 2.0 and WADL can be used to describe a REST service, but are not intended for automated generation of a REST service.
REST services are simple HTTP request/response,and therefore don't require complex stubs. In most cases it would probably take more time to write the WSDL describing the REST service, than it would take to write the REST service itself.