I believe I read in a previous post on Nabble as well as in the
documentation that RESTful services cannot return Collections, in particular
generic collections like List<MyClass>.  I have a few questions concerning
this:

1.  Can someone explain WHY this is so.  I have a base service
implementation that is both a JAXWS service and a JAXRS service.  JAXWS has
no problem returning a collection. I'd prefer not to have to change the
return type just to satisfy my REST needs.

2. The User doc mentions several alternatives to creating a custom wrapper
class for the collection, but does not provide any examples of the
alternatives, in particular


   - "one can provide an Object factory which will tell JAXB how to marshal
   a given type (in case of Collections - its template type)"  This sounds like
   just what the doctor ordered.  Can anyone provide an example of this and
   will it somehow screw up my JAXWS calls
   - "Another option is to register one or more JAX-RS ContextResolver
   providers capable of creating JAXBContexts for a number of different types.
   The default JAXBElementProvider will check these resolvers first before
   attempting to create a JAXBContext on its own.+ -- Not sure if this will do
   what I need, but I'd like a code example if possible.

Finally, if neither of the above are what I'm looking for, any other
ideas/code patches?

Thanks in advance

Rudy Bonefas
Next Century Corp.
Senior Code Monkey

Reply via email to