Difference between JAX-WS, Axis2 and CXF
Asked Answered
M

4

148

What is the difference between:

  1. JAX-WS
  2. Axis2
  3. CXF

All three can be used to create webservices in Java.
As of I know JAX-WS is a specification and Axis2 and CXF are implementations, but Java 1.6 has implementation of JAX-WS if I am not wrong.

So one can use Java 1.6 to develop JAX-WS web services without using Axis2 or CXF? Then what is the use of Axis2, CXF?

Manipulator answered 19/7, 2012 at 17:56 Comment(0)
A
155

The JAX-WS implementation built into the JDK really is just the basic soap stuff. If you need any of the more complex WS-* things like WS-Security, WS-RM, WS-Policy, etc..., you need to use one of the alternatives like CXF or Metro or Axis2. It can also depend on what you are trying to integrate with. For example, CXF has top notch Spring support as well as very good OSGi support.

CXF also has other things besides just JAX-WS. It has a compliant JAX-RS implementation as well and supports exposing services as both REST and SOAP very well. Has a W3C compliant SOAP/JMS implementation if that type of things is required. Basically, lots of stuff not available from the in-jdk JAX-WS impl.

Also see:

Difference between Apache CXF and Axis

Aec answered 19/7, 2012 at 18:33 Comment(4)
Thanks, helps alot. So for the basic web service stuff i can just use java 1.6 to implement.And was their a implementation of jax-ws in java 1.5? Or it was added after 1.6? If i need additional features i can go with CXF?Manipulator
It was added in 1.6. If you need 1.5 support, you would need to grab CXF or the JAX-WS reference impl or similar.Aec
And for the most part, if you start with the in-jdk JAX-WS impl, you can drop in CXF at any time and it would still work.Aec
I have a little doubt. Is not Metro -The JAX-WS implementation built into the JDK? Or Metro is more sophisticated than JAX-WS implementation built into the JDK?Bantu
P
19

In short.

WSDL WS-* are language-agnostic.

JAX-WS are Java standard to build web service.

Apache CXF and Apache Axis 2 are two implementations of JAX-WS. They also offer JAX-RS implementations so that you can build Restful services.

CXF has better integration with Spring, and Camel(camel-cxf). And Axis 2 seems not have a active release.

Pertussis answered 2/5, 2014 at 18:25 Comment(0)
O
15

I found with CXF - integration with Spring is very easy. Moreover, It provides various features like:

  1. Customization of Logging features
  2. Inbound and Outbound interceptor
  3. Application Level security
  4. Easy Exception handling using custom Fault.

For more detail, if you want, please checkout this link:

http://predic8.com/axis2-cxf-jax-ws-comparison.htm

http://www.ibm.com/developerworks/java/library/j-jws11/

And, I read above links, its preety helpful for me. I hope it works for u too.

Thanks !

Observant answered 11/2, 2014 at 11:58 Comment(0)
M
3

Web Service organization reles some guidelines i.e BP(Basic Profile) 1.0 and BP(Basic Profile) 1.1. Base on the Guidelines All Language(Java/.Net) people release Specification with Default implementation In java Base on BP 1.0 Specification Is JAX-RPC And 1.0 Specification Is JAX-WS

JAX-WS Default implementation is RI(Reference Implementation) Base on the requirement/Choice we can change the implementation(RI/AXIS-2/CXF)

When we are using java 1.6 that case in JDK already available so not required any other jar. If you want to use different implementation that case required particular implememtation jar.

Axis-2 and CXF come from Apache

Marcellmarcella answered 14/6, 2017 at 7:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.