|
From: Bill B. <bb...@re...> - 2012-12-05 21:39:23
|
Do:
ClientResponse<List<Pet>> getAllPets();
or
List<Pet> getAllPets();
If that doesn't work, please post your exception.
On 12/4/2012 10:12 PM, Shannon Sims wrote:
> 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")
> *public*ClientResponse<GenericType<List<Pet>>> getAllPets();
> =====================================================================
> I cannot get the client to build the list using the following code:
> ResteasyProviderFactory providerFactory =
> ResteasyProviderFactory./getInstance/();
> providerFactory.registerProvider( JAXBXmlTypeProvider.*class*);
> List<Pet> allPets = *new*ArrayList<Pet>();
> PetServiceInterface service = ProxyFactory./create/(
> PetServiceInterface.*class*, /REST_URL/);
> ClientResponse<GenericType<List<Pet>>> response = service.getAllPets();
> **
> *if*( response.getStatus() == 200 )
> {
> List<Pet> pets = _response.getEntity( List.__*class*)_;
> System./out/.println( pets );
> }
> *else*
> {
> System./out/.println("Request processing failed. HTTP Status: "+
> response.getStatus()
> + " "+ response.toString());
> }
> response.releaseConnection();
> **
> Thanks for your time and help!
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
>
>
>
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|