Skip to content

Toro Cloud Dev Center


Generating services

Martini has the ability to generate services from many different sources. These include:

From an HTTP request

The HTTP client service wizard allows you to easily create services that send HTTP requests and consume HTTP responses. All you have to do is specify the details of the endpoint where the requests will be sent and the wizard will take care of the rest. This is similar to Postman.

To generate a Gloop HTTP client service, simply follow the steps below:

Generating an HTTP endpoint-calling service

Generating an HTTP endpoint-calling service

  1. Under the Navigator view, right click on your target package's code directory or any of the directories underneath it where you'd like your service to reside. Then select New > Gloop HTTP Client Service.
  2. On the first page of the wizard, enter the name of your to-be-created service. Click Next or press .
  3. In the following page, specify the method, URL, parameters, body, headers, and response type of the HTTP endpoint that will receive the requests. Additionally, you can opt to create a Gloop model from the endpoint's response and specify how the response will be represented in Gloop.

    Path variables

    Indicate path parameters by wrapping them with ${}. For example:

    1
    https://target.site/users/${id}
    

    You can also double click on path parts to have them automatically wrapped for you.

  4. Click Finish to finally generate the service.

From an HTTP Client request

The HTTP Client1 is a tool that comes with Martini Desktop for sending HTTP requests. HTTP requests configured in the HTTP Client can be exported as services. This can be done using either the request group tree's context menu or through the HTTP Client's toolbar.

Generating an HTTP endpoint-calling service

  1. From the request group tree, right click on the HTTP request you want to convert, and then select Export as Service.

    Alternatively, you can use the Export as Service button at the top right side of the HTTP Client view. Ensure that the HTTP request you want to export is opened and is the currently selected tab and click on this button.

  2. After completing step #1, the HTTP client service wizard will appear. Populate the fields required by the wizard.

    • Location is for specifying where the service should be created.
    • Name is for specifying the name of the service. Typically, the name is generated based on the assigned name of the HTTP request.
  3. Click Next if you want to view and edit the configuration generated for the new Gloop HTTP client service; otherwise, click Finish.

  4. If you've clicked Next, the service configuration page will be shown. Edit the request data as you wish. Once done, click Finish.

Mock variables are evaluated

Variables in the request are automatically evaluated in the HTTP client service wizard.

Mock variables evaluated in the HTTP client service wizard

From the TORO Marketplace

The TORO Marketplace also hosts schemas of various APIs. Instead of having to manually look for your API's specification document, you can just pick them up from the TORO Marketplace and proceed to generating services. To do this, follow the steps below:

Generating services out of API schemas from the Marketplace

  1. Open the TORO Marketplace dialog by clicking the TORO Marketplace button in the toolbar.
  2. Search for and select the API schemas you want to generate services by checking their checkboxes. To show only API schema files in the dialog, select API Schema as the Type. Further filter through the entries by typing the API's name in the search bar.
  3. Select the instance where you want the selected packages to be installed.
  4. Click Install.
  5. A new dialog will appear, showing the items you want to install. Click Next.
  6. Another dialog will appear for specifying where the services would be generated. To install the services to a new package (by default, named after the API schema's Marketplace ID), check the Install as New Package checkbox. Otherwise, specify the destination package/directory using the Location field.

Generating services out of API schemas from the Marketplace

  1. Open the TORO Marketplace dialog by clicking the TORO Marketplace button in the toolbar.
  2. Search for and select the API schemas you want to generate services by checking their checkboxes. To show only API schema files in the dialog, select API Schema as the Type. Further filter through the entries by typing the API's name in the search bar.
  3. Click Install.
  4. In the appearing dialog, specify which package and directory the services would be saved to. If you want to create a new code directory for your services, indicate the package's name via the New folder field (a value is provided by default). Click Finish.

  1. Not to be confused with Gloop HTTP client services.