Network Deployment (Distributed operating systems), v8.0 > End-to-end paths > Web services - RESTful services


 Using WADL to generate service documentation

Web Application Description Language (WADL) is a description language for HTTP-based applications. It is currently a World Wide Web Consortium (W3C) Member Submission. WADL can be used by programs to give information about the service in a machine-processable method. For instance, you can use an Extensible Stylesheet Transformation (XSLT) document to transform the WADL documentation by using a custom XSLT and a XSLT processor. JAX-WS

By default, a WADL document can be requested for a particular resource by invoking an HTTP OPTIONS request for any Java API for RESTful Web Services (JAX-RS) URL. We can issue an OPTIONS request with most HTTP clients. The WADL document returned from the request describes the resource using information from the JAX-RS annotations.

New feature: WADL is a developing standard which helps describe the services available to users. WADL documents are written in XML. Using XSTL or XML parsers, developers can generate documentation for the service. In some cases, users may develop clients to dynamically understand the RESTful service by inspecting the WADL document.

Use IBM JAX-RS, developers can generate a JAXB XML representation of a WADL document describing all of the resources available in the application. The JAXB representation can be returned from a JAX-RS resource method. Then, the WADL document resource is treated like any other JAX-RS resource and can be used by clients. New feature:


Procedure

  1. Configure the development environment.

  2. Define the resources in JAX-RS web applications.

  3. Configure the JAX-RS application.

  4. Use WADL to generate service documentation.

  5. Assemble JAX-RS web applications.

  6. Deploy JAX-RS web applications.


Results

You have added a WADL service document to the application to enable clients to retrieve a representation of your service. By default, you can also issue OPTIONS requests to your resources to retrieve a WADL representation of the individual resource. If we have chosen to do so, you can disable the automatic generation of a WADL document for OPTIONS requests.



Related reference

Web services specifications and APIs









+

Search Tips   |   Advanced Search