There are many possible ways to generate WADL using CXF:
- You can send a REST call (e.g. Postman ) to the REST URL base, and it will automatically create a WADL for all services available from there. This can help structure the REST API. For example:
- CXF 3.0.0 and 2.7.11 are a java2wadl plugin for generating WADL during build. Details can be found here .
- All of the available CXF functionality regarding WADL is in the CXF docs .
After creating WADL, it would be convenient to convert XML to a more readable form. One solution I found was to use XSL to generate HTML. I used XSL from the github project . The steps for linking XSL to XML and generating a pretty HTML report:
- Download wadl.xsl;
- Copy the wadl.xsl file to the folder containing the wadl.xml file that CXF generated;
Add the required header in wadl.xml to the top of the file:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="wadl.xsl"?>
Replace the <application ...> header in the created wadl.xml using <wadl:application xmlns:wadl="http://wadl.dev.java.net/2009/02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://wadl.dev.java.net/2009/02 wadl.xsd ">
Add to each wadl tag namespace. For instance:
<resource> β <wadl:resource>
</resource> β </wadl:resource>
Open wadl.xml with IE
You will get something like this (example_wadl.xml from the github project ): 
source share