Retrieving a WADL representation

You can retrieve a WADL representation of request and response elements, and their documentation.

Before you begin

  • Before you can use the REST API in a client, you must start the sample server or configure Rule Execution Server for your application server. See Starting and stopping the sample server or Configuring.
  • Use the apiauth option to authenticate at run time if you use a tool that can process the WADL code to generate a client graphical user interface or API.

About this task

You can use the format of REST resource URIs to retrieve a representation of the REST API and its documentation in WADL format. The WADL format is described in the Web Application Description Language External link opens a new window or tab page of the W3C website.

Note: You can also open and save the .wadl file from the Rule Execution Server console.

Procedure

  1. Define the request as follows:
    http://{host}:{port}/{resContext}/apiauth/DecisionServer.wadl

    The URI variables are defined in Resource URIs.

    Example:
    http://localhost:9080/res/apiauth/DecisionServer.wadl
  2. Optional: To add XSD files in the WADL code, use the inline query parameter.
    http://localhost:9080/res/apiauth/DecisionServer.wadl?inline
    If you do not specify the inline parameter, the external .xsd files that are referenced by the .wadl file remain external. The .wadl file might not work correctly with some tools from independent software vendors. If you specify the inline parameter, the .xsd files are included in the .wadl file.

Results

If you try to generate WADL code from an invalid XML request or if an error occurs during the WADL generation, an error status code is returned.
  • If you sent the request from a browser, an HTML page displays the error message.
    Note: The status code is 200 despite the error message because it applies to the HTML page, not to the request result.
  • If you sent the request from a client other than a browser, status code 404 (Not Found) is returned and the error is described in XML code.
Error messages are described in HTTP status codes.