...
Tip |
---|
You need to have WSO2 ESB tooling installed to create a new API or to import an existing API via ESB tooling. For instructions on installing WSO2 ESB tooling, see Installing WSO2 ESB EI Tooling. |
Creating a new API
Anchor | ||||
---|---|---|---|---|
|
Follow these steps to create a new API.
- In Eclipse, click the Developer Studio menu and then click Open Dashboard. This opens the Developer Studio Dashboard.
- Click REST API on the Developer Studio Dashboard.
- Leave the first option selected and click Next.
- Type a unique name for the new API and specify the context, hostname, and port. For more information, see Configuring Endpoints using REST APIs.
- 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.
- 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.
Anchor | ||||
---|---|---|---|---|
|
Follow these steps to import an existing API into an ESB Config project.
- In Eclipse, click the Developer Studio menu and then click Open Dashboard. This opens the Developer Studio Dashboard.
- Click REST API on the Developer Studio Dashboard.
- Select Import API Artifact and click Next.
- Specify the XML file that defines the API by typing its full pathname or clicking Browse and navigating to the file.
- 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.
- If there are multiple API definitions in the file, click Create ESB Artifacts, and then select the artifacts you want to import.
- 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.
...