Questions tagged [cxf]

Apache CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI.

Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI. Here are some of the reasons you might want to use CXF:

  1. JAX-WS Support:

CXF implements the JAX-WS APIs which make building web services easy. JAX- WS encompasses many different areas:

  • Generating WSDL from Java classes and generating Java classes from WSDL
  • Provider API which allows you to create simple messaging receiving server endpoints
  • Dispatch API which allows you to send raw XML messages to server endpoints
  • Much more...

    1. Spring Integration:

Spring is a first class citizen with Apache CXF. CXF supports the Spring 2.0 XML syntax, making it trivial to declare endpoints which are backed by Spring and inject clients into your application.

  1. Aegis Databinding:

Aegis Databinding (2.0.x) is our own databinding library that makes development of code-first web services incredibly easy. Unlike JAXB, you don't need annotations at all. It also works correctly with a variety of datatypes such as Lists, Maps, Dates, etc. right out of the box. If you're building a prototype web services that's really invaluable as it means you have to do very little work to get up and running (and one of the primary reasons XFire was started a while back).

  1. RESTful services:

CXF enables the development of RESTful services via annotations using the HTTP Binding. Using URI templates and annotations you can bind a service operation to arbitrary URL/verb combinations. For instance, you can annotate a getCustom method with @Get @HttpResource("/customers/{id}"). CXF will then listen for GET requests on that URL and using the parameter at the {id} location as a parameter to the service.

  1. List item:

CXF supports a variety of web service specifications including WS-Addressing, WS-Policy, WS-ReliableMessaging and WS-Security.

For more information please refer:

Home Page: http://cxf.apache.org/

Apache CXF Software Architecture Guide: http://cxf.apache.org/docs/cxf-architecture.html

Downloads: http://cxf.apache.org/download.html

5478 questions
190
votes
10 answers

How to avoid the need to specify the WSDL location in a CXF or JAX-WS generated webservice client?

When I generate a webservice client using wsdl2java from CXF (which generates something similar to wsimport), via maven, my services starts with codes like this: @WebServiceClient(name = "StatusManagement", wsdlLocation =…
181
votes
6 answers

Difference between Apache CXF and Axis

What are the advantages of using Apache CXF over Apache Axis and vice versa?
Prabhu R
  • 13,836
  • 21
  • 78
  • 112
147
votes
4 answers

Difference between JAX-WS, Axis2 and CXF

What is the difference between: JAX-WS Axis2 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…
Maverick Riz
  • 2,025
  • 5
  • 19
  • 23
97
votes
7 answers

Read response body in JAX-RS client from a post request

Having some sort of proxy between a mobile app and a web-service, we are puzzled by the response when issuing a post request. We receive response with status 200: OK. But we can not find/extract the JSON response body. Client client =…
user2657714
  • 1,134
  • 1
  • 8
  • 7
81
votes
6 answers

Which framework is better CXF or Spring-WS?

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…
Kevin
  • 7,856
  • 11
  • 35
  • 40
75
votes
5 answers

Java REST implementation: Jersey vs CXF

What do you think is the advantages/disadvantages between this two libraries? Which of these two are best suited for production environment? By the way I will be using JSON instead of XML. I also would like to know what library is most supported by…
dexter
  • 1,869
  • 2
  • 14
  • 13
61
votes
1 answer

How to route Rest request from a local service to a remote one using Camel

I am trying to route a rest request from a cxf rest service to another. I have had a look at http://camel.apache.org/cxfrs.html which helped understand part of the process. I have a classCastException at the level of the remoteService Invocation. …
redben
  • 5,578
  • 5
  • 47
  • 63
58
votes
4 answers

CXF JAXRS - How do I pass Date as QueryParam

I have a service defined as follows. public String getData(@QueryParam("date") Date date) I'm trying to pass a java.util.Date to it from my client (which is jaxrs:client of CXF, not a generic HTTP client or browser). My service receives the date as…
domino
  • 683
  • 2
  • 7
  • 10
51
votes
6 answers

Use CXF JaxWsServerFactoryBean exception Cannot find any registered HttpDestinationFactory from the Bus

When use Apache CXF JaxWsServerFactoryBean in console mode (try to start the server by java command line) Will get exception like below: Caused by: java.io.IOException: Cannot find any registered HttpDestinationFactory from the Bus. at…
Anderson Mao
  • 1,101
  • 1
  • 9
  • 7
50
votes
11 answers

How to log Apache CXF Soap Request and Soap Response using Log4j?

I am using the Apache CXF Framework. Inside my client program, I need to log CXF SOAP Requests and SOAP Responses. When I used JaxWsProxyFactoryBean factory = new…
Pawan
  • 31,545
  • 102
  • 256
  • 434
50
votes
3 answers

How do I prevent JAXBElement from being generated in a CXF Web Service client?

I'm trying to create a web service client using CXF to consume a WCF web service. When I use wsdl2java it generates objects with JAXBElement types instead of String. I read about using a jaxb bindings.xml file to set generateElementProperty="false"…
ScArcher2
  • 85,501
  • 44
  • 121
  • 160
46
votes
6 answers

JAXB Exception: Class not known to this context

When I call a particular restful service method, which is built using CXF, I get the following error, anyone know why and how to resolve it? JAXBException occurred : class com.octory.ws.dto.ProfileDto nor any of its super class is known to…
ABK07
  • 515
  • 1
  • 4
  • 7
43
votes
3 answers

How to return a partial JSON response using Java?

I'm building a RESTful API and want to provide developers with the option to choose which fields to return in the JSON response. This blog post shows examples of how several API's (Google, Facebook, LinkedIn) allow developers to customize the…
Justin
  • 6,031
  • 11
  • 48
  • 82
43
votes
11 answers

CXF: No message body writer found for class - automatically mapping non-simple resources

I am using the CXF rest client which works well for simple data types (eg: Strings, ints). However, when I attempt to use custom Objects I get this: Exception in thread "main" org.apache.cxf.interceptor.Fault: .No message body writer found for class…
javamonkey79
  • 17,443
  • 36
  • 114
  • 172
43
votes
3 answers

How can I pass complex objects as arguments to a RESTful service?

I have successfully set up a quick test of creating a "REST-like" service that returns an object serialized to JSON, and that was quite easy and quick (based on this article). But while returning JSON-ified objects was easy as peach, I have yet to…
oligofren
  • 20,744
  • 16
  • 93
  • 180
1
2 3
99 100