Generating a WADL representation

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

Before you begin

Before you can use the REST service 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.

About this task

To write XML input for the POST method to a specific ruleset endpoint URI, you can generate the WADL representation. The WADL representation contains two entries for a POST method and one for a GET method. A set of XSD files are attached to this method to describe the XML representation of the input and output objects.

To generate a WADL representation, you can use the endpoint URIs. The WADL format is described in the Web Application Description Language page of the W3C website.

Procedure

  1. Define the request:
    http://{host}:{port}/DecisionService/rest/v1/{rulesetPath}/wadl

    The URI variables are defined in Endpoint URIs.

    Example:
    GET http://localhost:9080/DecisionService/rest/v1/miniloanruleapp/1.0/miniloanrules/1.0/wadl
  2. Optional: To add the XSD files in the WADL code, use the inline query parameter.
    Example:
    GET http://localhost:9080/DecisionService/rest/v1/miniloanruleapp/1.0/miniloanrules/1.0/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.
    Note: In WebSphere® Application Server, you must explicitly set the inline value to true.
    GET http://localhost:9080/DecisionService/rest/v1/miniloanruleapp/1.0/miniloanrules/1.0/wadl?inline=true
  3. Optional: To generate the WADL code and its XSD files to a compressed file, add the zip parameter.

    If you specify the zip parameter, the inline parameter is not necessary.

    Example:
    GET http://localhost:9080/DecisionService/rest/v1/miniloanruleapp/1.0/miniloanrules/1.0/wadl?zip=true 

Results

If you try to generate WADL representation for an invalid URL 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.
You can find a description of error messages in HTTP status codes.