Developers, Developers, Developers! Maksim Sorokin IT Blog

2Aug/11Off

Maven + Apache Felix + CXF: RESTful Webservice with CXF. Using POST.

It is another post in Maven + Apache Felix + CXF + DOSGi Series.

In this post I showed you how to create a RESTful webservice consuming and creating a String. However, the example was using @GET method. Here I will show, what changes need to be done in order to consume input from @POST. As usual, sources are available in the end of the post.

Simply change @GET to @POST and remove

24Jul/11Off

Maven + Apache Felix + CXF: Creating a RESTful Webservice with CXF. Returning and Object.

It is another post in series Maven + Apache Felix + CXF + DOSGi.

This example is based on a post about simple JAX-RS webservice with CXF. But this post describes a way how to return a more complex object, instead of a String.

First, we create a class in our test.bundle bundle MyMessage in package test.bundle:

package test.bundle;

public class MyMessage {

  private String message;

  public MyMessage(String message) {
    this.message = message;
  }

  public String getMessage() {
    return message;
  }
}

We will return this object in XML format to REST webservice requester. We will use

21Jul/11Off

Maven + Apache Felix + CXF: Creating a RESTful Webservice with CXF. A Simple String Example.

This is next post in Maven + Apache Felix + CXF + DOSGi series.

This is example is based on the sample application developed in previous post. Again, it is assumed here that you are using M2Eclipse plugin, if you want to run examples from Eclipse.

As usual, source is included in the end of the post.

First of, we need to