Previous Topic: Create a Service Image from WADLNext Topic: Create a Service Image from Layer 7


Create a Service Image from RAML

This procedure describes how to create a virtual service image from RESTful API modeling language (RAML).

A RAML can define message bodies using a combination of Schema and Example properties. The Example property is used for the transaction body in DevTest. Make sure to specify the Example property in a message body, or else the Schema property is used instead.

Important! The Schema property is not interpreted in any way and appears exactly as specified in the transaction body within DevTest.

Follow these steps:

  1. Complete one of the following options:

    The Virtual Service From RAML window opens.

  2. Enter a service image name and the name of a VS model file.

    Note: To load parameters from a previously saved service image, click Load from File Image of blue folder icon at the bottom of the window.

    For more information about field descriptions, see Basics Tab.

  3. Click Next.
  4. In the Listen on port field at the bottom of the window, enter the port number to which the virtual service listens.
  5. In the RAML URL field, add the RAML of the web service to virtualize.

    You can also select the RAML from the drop-down list, or click the Browse button to locate the RAML from the file system.

    This entry can be a RAML file on the file system or a URL.

  6. Click Refresh RAML Cache .

    DevTest parses the RAML and populates the Endpoint field and the Methods pane.

    Note: If DevTest fails to parse the RAML, a warning icon displays after the Endpoint field. To view the error message, click the warning icon.

  7. In the Methods pane, select the methods to virtualize.

    By default, all the methods are selected. You can click Select All or Select None, as appropriate. At least one method is required.

  8. Click Next.
  9. Add or chain other Data Protocol Handlers as appropriate. By default, the Rest Data Protocol Handler is selected.
  10. Click Next.

    On the next window, the service image is generated and the wizard is finished.

  11. Click Finish.

    To save the settings on this recording to load to another service image recording, click Save Image of the Save icon above the Finish button.

Note: The parameter lisa.vse.rest.max.optionalqueryparams specifies the maximum number of optional query parameters to process per method in a RAML file. The default is five; any optional parameters after the fifth one are ignored. We recommend that you do not change the value above five. This can result in the number of generated responses growing exponentially after the fifth one.