Nothing fancy, something like (annotated with Jersey)
Code:
@Path("/data")
public interface DataService {
@GET
@Path("/data/{entity}/{key}")
@Produces("text/xml")
String read(@PathParam("entity")String entity, @PathParam("key")String key);
}
Then, the service handler invokes the implementation method, like this
Code:
Object[] objs = (Object[]) message.getPayload();
Method method = methods.get(message.getHeaders().get("internal.header.invokedmethod"));
Object response = ReflectionUtils.invokeMethod(method, service, objs);
return response == null ? new GenericMessage<Object>(new NullObject()) : new GenericMessage<Object>(response);
Now this situation returns a String, but in other situations I had "custom" objects being returned without any problem. Only this NullObject gives the problem...