RESTful JiBX web service example

Instructions on building and running a JiBX web service example using Apache CXF.

This example is a simple JAX-RS (RESTful service) example using JiBX bindings.

You can find this web service sample here in our source repository. This example is very similar to the CXF REST web service example in the servicemix distribution.

This example is very simple. You send a RESTful request either as a URL or you can post an XML request. The service returns an XML reply.

Running this example

Step 1: Download Apache karaf and fire it up.

 bin/karaf

Step 2: Add cxf and start it.

karaf@root> features:addurl mvn:org.apache.cxf.karaf/apache-cxf/3.0.3/xml/features
karaf@root> features:install cxf cxf-databinding-jibx http

Step 3: Install the test JiBX REST web service and run it.

 install -s mvn:org.jibx.test.examples/org.jibx.examples.cxf.rs

Step 4: Startup your browser and click on this link

http://localhost:8181/cxf/crm/customerservice/customers/123

Your browser will return an XML representation of this customer.