I am using Wink 1.1.2. I have a resource like the following:

@Path("/myresource")
public class MyResource {
    @GET
    @Produces(MediaType.APPLICATION_XML)
    public Map<String,Foo> getResults() {
        Map<String,Foo> results = new HashMap<String,Foo>();
        .... //populate results
        return results;
    }
}


This doesn't work, I get an error like 'The system could not find a
javax.ws.rs.ext.MessageBodyWriter or a DataSourceProvider class for the
java.util.HashMap type and application/xml;q=0.9 mediaType'

Class Foo has JAXB annotations, so if I just return a single Foo instance
then it works fine.

RESTEasy appears to support the Map type
(http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Web_Platform/5/html/RESTEasy_Reference_Guide/JAXB_Map.html)
so I am wondering if Wink has some kind of similar support.

Thanks, Kelly

--
View this message in context: 
http://apache-wink-users.3471013.n2.nabble.com/Support-for-Map-type-tp6510043p6510043.html
Sent from the Apache Wink Users mailing list archive at Nabble.com.

Reply via email to