WADL is an XML description for the deployed RESTful web service. It is supported using the Jersey implementation, and is similar to SOAP's Web Services Description Language (WSDL).
Like WSDL that shows the structure, functionality, and parameters, and accepts different HTTP methods of the SOAP web services, WADL also provides the same features. The difference between the two is that WADL is used for RESTful-based web services, and WSDL is used for SOAP-based web services.
Let's see how WADL looks for our resource class:
@Path("/getResource") public class GetResource { @GET public String get() { return "Hello World!!!"; } @GET @Path("{name}") public Response greetUser(@PathParam("name") String name){ returnResponse.status(200).entity("Hello, " + name).build(); } }
Here, we have two @GET
resource methods under the getResource
path. Once the application is deployed on the server, open the URI in a browser:
http://localhost:8080/Chapter6...