Java Reference
In-Depth Information
Working with WADL
Problem
You've found a web service that exposes a WADL (Web Application Description Language)
file and you want to generate portable Java objects based on the WADL. Or, you are pub-
lishing a “RESTful” web service and want to provide an interface for it that is simpler than
WSDL and allows clients to generate code, and WADL seems perfect.
Solution
You can check out the WADL whitepaper at http://research.sun.com/techrep/2006/ab-
stract-153.html .
If you want to use the wadl2Java tool to generate client code, it's available for the command
line, Ant, and Maven at https://wadl.dev.java.net/ .
Discussion
The WADL project started in 2006. WADL was created by Marc Hadley at Sun, and was con-
ceived to “provide a machine processable protocol description format for use with…HTTP-
based Web applications, especially those using XML.” In other words, it's an attempt at an
IDL for web apps.
That's just fine, and it may have some laudable uses. But it's not REST. The concern is not
really about WADL itself, but rather that WADL subverts one of the central tenets of REST,
which is hypermedia as the engine of application state.
Appendix A of the WADL specification uses an example similar to this (I've tightened it up):
<resources base="http://example.com/widgets">
<resource>
<path_variable>
<method id="ItemSearch" name="GET">
<request>
<query_variable name="Operation" fixed="ItemSearch">
</request>
<response>
<representation mediaType="text/xml"
element="aws:ItemSearchResponse" />
</response>
</method>
Search WWH ::




Custom Search