8
votes

Sorry fot his newbie question. But I really need a start on this one. I want to access a webservice in my Java EE project. This webservice offers a WSDL file. So I understand I can use this to build Java code from it to access the web service. Now I read that Apache CXF is a good framework that I can use. But what's the difference to JAX-WS?

Could someone please explain this to me?

4

4 Answers

12
votes

JAX-WS is a Specification (provided by Sun Oracle) to defining Web Services by use of Annotations.

Apache CXF is a framework that implements JAX-WS to generate Web Services Definitions and Java Proxy (from a Web Service Definitions)

Apache Axis 2 is also a framework that now supports JAX-WS (up to JAX-WS 2). It's an improvement from Apache Axis. CXF supports up to JAX-WS 1.2.

Brief tutorial can be found here.

5
votes

JAX-WS is an API (or specification) and CXF is an implementation of that API. There is also a reference implementation available here

3
votes

CXF is good but you don't need it to solve your problem. You can use wsimport, which comes as part of the JDK, to generate classes from the WSDL to access the web service.

1
votes

The other answers are correct, but with CXF or Metro you are getting an implementation web services stack and with that are extra features beyond the JAX-WS api. That is why JAX-WS RI also has more features available than just JAX-WS.

I think this article explains this very well in detail.

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