users@jersey.java.net

Unmarshalling list of Jaxb elements using jersey client

From: Erdinc Yilmazel <erdinc_at_yilmazel.com>
Date: Tue, 10 Mar 2009 16:24:25 +0000

I have methods returning list of objects that are annotated with @XmlRootElement

   @XmlRootElement(name = "registryEntry")
   public class RegistryEntry {
      ...
   }

   @GET
   @Produces({"application/xml", "application/json"})
   public ArrayList<RegistryEntry> getEntries(....) {
       ...
   }

This works fine on the web service side, however I could not find a
way of getting list of RegistryEntry classes on the client side. I
know I can write a wrapper class and return it rather than an
ArrayList, and unmarshall it on the jersey client side, but I will
have to write many of these then.

Any ideas for calling this service using jersey client?