Hi Tim,
just back from holiday and going through my emails... :)
On Wed, 2008-08-20 at 15:11 -0700, Tim McCune wrote:
> In the WADL that Jersey is generating for my resources, it seems to be
> leaving off the "element" attribute. For example, for the resource:
>
> @GET
> public HelloWorld sayHello() {...
>
> where the returned class is annotated as an @XmlRootElement, I would
> expect the WADL to contain
>
> <representation mediaType="application/xml" element="helloWorld"/>
The element should be defined together with a namespace like this:
element="example:helloWorld" xmlns:example="
http://www.example.com"
Additionally the /application/grammars element should include some xsd
that contains the definitions for this element within the example
namespace.
This is nothing that the wadl generator (WadlGeneratorImpl) can read at
runtime from the compiled resource classes (and request/response
representations). The same applies to resource methods that just return
a Response (in this case it's also not possible to determine which
response representations can be returned) or response headers that are
set in the resource method implementation.
To support this (and also support for adding doc elements containing
javadoc) I added some "extension points" to the jaxb generation, so that
one can define e.g. a grammars element that will be added to the
generated wadl or some javadoc tags for specifying response params.
There's of course still room for improvement, more in reply to your next
mail...
Cheers,
Martin
>
> but instead I'm just getting
>
> <representation mediaType="application/xml"/>
>
> Is there any way to get the element to show up in the generated WADL?