Skip to content

Home

Introduction

Development

IDEs

Services

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

Generating Gloop services

If your API is already defined, then there's no need to create your Gloop services from scratch. You can generate services from different types of sources like an API schema, HTTP request, or a schema from the TORO Marketplace.

From an HTTP request

The HTTP client service wizard allows you to easily create Gloop 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 Gloop service

Generating an HTTP endpoint-calling Gloop 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 Gloop 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 Gloop service

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

    Alternatively, you can use the Export as Gloop 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 doing 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 Gloop 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 Gloop 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 package 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.