I need to get WADL file for RESTful service. I know that in case using jersey it's available as http://localhost:8080/application.wadl
. But I use RESTeasy.
Can I do the same in my framework case?
I need to get WADL file for RESTful service. I know that in case using jersey it's available as http://localhost:8080/application.wadl
. But I use RESTeasy.
Can I do the same in my framework case?
Latest versions:
Quoting Chapter 49. RESTEasy WADL Support:
Workaround for Older versions
There is a workaround: a maven plugin called
maven-wadl-plugin
by the jersey folks that also works to generate WADL for services coded using RESTEasy.Here's how to use it.
1. Add this to your
pom.xml
:Pay attention to the
baseUri
andpackagesResourceConfig
elements. You have to change them to reflect your project's configuration. You may also want to change the plugin's version (I used 1.17).2. Create a /doc folder and add some files.
Create the
src/main/doc/
folder and create the two files below.File: application-doc.xml
Content:
File: application-grammars.xml
Content:
3. Run the maven command.
Go to the project folder and run the following command:
The files
\target\classes\application.wadl
(the WADL itself) and\target\classes\xsd0.xsd
(the schema of the resources - it's used by the application.wadl) should be generated.Edit and use them as you wish.
PS.: Bear in mind that this is a very simple use of the maven-wadl-plugin. It can do a lot more. To know it better, please refer to the zip file in http://search.maven.org/remotecontent?filepath=com/sun/jersey/samples/generate-wadl/1.12/generate-wadl-1.12-project.zip
we can generate a wadl with the help of maven project with POM.XML
https://issues.jboss.org/browse/RESTEASY-166 check the comments here..!!
See RESTEasy WADL Support (3.1.0). The snipped below is copied from there
This uses the
ResteasyWadlServlet
and will make the WADL accessible at/application.xml
.Note: Rex and Jaskirat have already mentioned previously that RESTEASY-166 was used to manage the implementation for this feature. It seems this was completed in 3.0.14.
WADL generation in RESTeasy is a feature not yet implemented. If you want it go vote for it.
https://issues.jboss.org/browse/RESTEASY-166