Which framework is better CXF or Spring-WS?

Viewed 59340

I am in the process of researching/comparing CXF and Spring-WS for web services? I need to function both as a provider and a consumer of WS. In a nutshell, I have been told that Spring-WS is more configurable, but CXF is easier to get up and running. This question is subjective, but will help direct me in my research.

  • What experience do you have with either of these frameworks?
  • Have you run into any pitfalls with either framework?
  • Have you found any useful features provided by either that is possibly not provided by the other?
6 Answers

CXF does not, in any way, prevent you from starting with a contract (WSDL). I used both of these products to build a web service.

In CXF, I used Maven and the Maven plugin, calling the wsimport goal to generate the SEI (interface) which I then implemented. After implementing the interface to contain the actual service logic and configuring my bean implementation beans.xml, I then let Maven package it into a war file for deployment. The entire exercise could not have been easier.

I don't think Spring-WS offers any advantages that outweigh the lack of JAX-WS. CXF already lets you use Spring to wire up your beans and also has a full implementation of JAX-WS as well.

We have an experience with CXF and it's predecessor XFire and I can recommend it as solid, quick (WS creating and executing) and reliable framework.

Regarding the issues that you can met with CXF see my post https://stackoverflow.com/questions/289977/recommended-framework-for-java-web-services#290205 And I agree with toolkit, that the biggest difference between frameworks are ideologically: what is the first code (i.e. interface) or contract (i.e. wsdl). See some details here:

Related