|
From: Shannon S. <ssi...@ya...> - 2012-12-05 03:12:12
|
Hello,
I've struggled with getting a list of objects from the Rest server for almost 9 hours now. I've scoured the web to help me resolve this matter, but have had no luck!!! Can you please help? I'm going in circles and am becoming frustrated. The rest server displays the XML without any issues, however I'm having problems on the client side. I get the following error: Unable to find a MessageBodyReader of content-type application/xml and type null
=====================================================================
Here is the method for the client-side interface:
@GET@Path("___defaultcache")@Produces("application/xml")publicClientResponse<GenericType<List<Pet>>> getAllPets();
=====================================================================
I cannot get the client to build the list using the following code:
ResteasyProviderFactory providerFactory = ResteasyProviderFactory.getInstance();
providerFactory.registerProvider( JAXBXmlTypeProvider.
List<Pet> allPets =
PetServiceInterface service = ProxyFactory.create( PetServiceInterface.
ClientResponse<GenericType<List<Pet>>> response = service.getAllPets();
if( response.getStatus() == 200 ) List<Pet> pets = response.getEntity( List.;
System.
}
{
System.
+
}
response.releaseConnection();
Thanks for your time and help!class)out.println( pets ); elseout.println("Request processing failed. HTTP Status: "+ response.getStatus()" "+ response.toString());
{class);newArrayList<Pet>();class, REST_URL); |