On Thu, Oct 21, 2010 at 11:04 AM, Bryant Luk <[email protected]> wrote:
> Hi Luciano,
>
> Currently working on the WADL generator code in wink-common under the
> org.apache.wink.common.model.wadl package a bit. Originally I
> intended to just have users do something like:
>
> @Path("servicedoc")
> public class MyServiceDoc {
> @Context
> Application app;
>
> �...@get (or @OPTIONS)
> public org.apache.wink.common.model.wadl.Application get() {
> return new WADLGenerator.process(app.getClasses());
> }
> }
>
> Certainly if you have some thoughts or a different code path, I think
> everyone would be happy to see it.
>
Cool, this works with minimal tweaks....
@Path("servicedoc")
public class ServiceDoc {
@Context
Application app;
@GET
@Produces(MediaType.APPLICATION_XML)
public org.apache.wink.common.model.wadl.Application get() {
WADLGenerator generator = new WADLGenerator();
return generator.generate(app.getClasses());
}
}
I want to be able to automatically get WADL for any resource,
something like http://.../resource?wadl.
Maybe a handler could help on getting this automated, I'll play with
this in the next couple days...
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/