I have a REST web service that returns a “javax.ws.rs.core.Response” entity. When I run enunciate, it can’t determine the output type, so the response in the generated wadl is left blank:
If the code look like this:
@GET
@Path("/webservice")
@Produces({"application/xml"})
@TypeHint(myClass.class)
javax.ws.rs.core.Response methodCall(...
The WADL reads:
...
<wadl:representation mediaType="application/xml"/>
</wadl:response>
Rather than:
...
<wadl:representation mediaType="application/xml" element="ns1:myClass" xmlns:ns1="http://pathTo/schema"/>
</wadl:response>
It here anyway to get enunciate to recognize the Response return type?
Yes. Use the @org.codehaus.enunciate.jaxrs.TypeHint annotation on the method to give Enunciate a hint about the output type.