This documentation is for WSO2 Enterprise Service Bus version 5.0.0. For the latest ESB, view the latest WSO2 Enterprise Integrator documentation.

All docs This doc
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

You can use the ESB tooling plug-in to create a new API or to import an existing API from the file system. You can also add an API resource to an existing API via the ESB tooling plug-in.

You need to have the ESB tooling plug-in installed to create a new API or to import an existing API via ESB tooling. For instructions on installing the ESB tooling plug-in, see Installing WSO2 ESB Tooling.

Creating a new API

Follow these steps to create a new API. Alternatively, you can import an existing API.

  1. In Eclipse, click the Developer Studio menu and then click Open Dashboard. This opens the Developer Studio Dashboard.
  2. Click REST API on the Developer Studio Dashboard.
  3. Leave the first option selected and click Next.
  4. Type a unique name for the new API and specify the context, hostname, and port. For more information, see Configuring Endpoints using REST APIs.
  5. Do one of the following:
    • To save the API in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the API in a new ESB Config project, click Create new ESB Project and create the new project.
  6. Click Finish. The REST API is created in the src/main/synapse-config/api folder under the ESB Config project you specified. When prompted, you can open the file in the editor, or you can right-click the API in the project explorer and click Open With > ESB Editor. Click its icon in the editor to view its properties.

Importing an API

Follow these steps to import an existing API into an ESB Config project. Alternatively, you can create a new API.

  1. In Eclipse, click the Developer Studio menu and then click Open Dashboard. This opens the Developer Studio Dashboard.
  2. Click REST API on the Developer Studio Dashboard.
  3. Select Import API Artifact and click Next.
  4. Specify the XML file that defines the API by typing its full pathname or clicking Browse and navigating to the file.
  5. In the Save API In field, specify an existing ESB Config project in your workspace where you want to save the API, or click Create new ESB Project to create a new ESB Config project and save the API configuration there.
  6. If there are multiple API definitions in the file, click Create ESB Artifacts, and then select the artifacts you want to import.
  7. Click Finish. The APIs you selected are created in the subfolders of the src/main/synapse-config/api folder under the ESB Config project you specified, and the first API appears in the editor.

Adding an API resource

Follow these steps below to add an API resource to an existing API.

  1. Open an existing API in the editor.
  2. In the tool palette, click APIResource in the API section and simply drag and drop the resource to the REST API.
  3. You can now add mediators, endpoints etc to the resource and save.
  • No labels