users@jersey.java.net

how to generate WADL:Fault elements for exceptions?

From: Krishna K Kamity <krishna.kamity_at_gmail.com>
Date: Wed, 3 Jun 2009 14:14:47 -0700

I am new to REST/WADL stuff and I started using jersey for one of my
projects. (jersey-1.1.1.ea-snapshot)

I came across lot of articles on wadl particulary using yahoo search api as
an example. I understood how to generate client stubs using wadl and
wadl2java. But I am not able to understand how a WebApplicationException
gets converted to fault element in WADL?

For e.g, I have a very simple resource namely Project and it throws
EntityNotFoundException (a subclass of WebApplicationException) . what is
the process involved in representing this exception as a fault element in
WADL?

I took the following steps:

Created the Resource 'Project'
Created the Exception 'EntityNotFoundException' (subclass of WAE)

Used schemagen to generate corresponding xsd's
Used wadl-generator to generate wadl from those xsds.

However the generated wadl does not contain fault elements like the ones in
yahoo search API.

Could you please help me figure how to create those fault elements in wadl ?
is it a manual process?

Thanks in advance