Trying to get an Entity from a REST service. My code is like this:
I want to send in an object like this: new GenericType<List<MyObject>>() {}
to a methode like this:
public static Object callRestWithUrl(String url, Class<?> responseObject)
throws MetaServiceException {
ClientResponse response = RESTConnectionUtils.callMetaService(url);
result = response.getEntity(responseObject);
.....
But it gets evaluated to List during runtime and not GenericType and an exception is thrown.
How do you invoke your callRestWithUrl method?
It could be that it would work better if your method had the signature:
And that you then invoked it as this:
Maybe this web page can help: http://persistentdesigns.com/wp/2009/10/jersey-rest-client/