Skip to content

Create an Endpoint

Follow the instructions below to create a new Endpoint artifact in the WSO2 Integrator: MI for Visual Studio Code extension (MI for VS Code).

Note

For HTTP use cases, you can now use the HTTP Connector instead of defining an endpoint. See the HTTP Connector documentation for more information.

Create the endpoint artifact

  1. Launch Visual Studio Code with the WSO2 Integrator: MI for VS Code extension (MI for VS Code) installed.

    Info

    Follow the Install WSO2 Integrator: MI for VS Code documentation for a complete installation guide.

  2. Create an integration project.

  3. To add a new Endpoint, navigate to WSO2 Integrator: MI Project Explorer.

  4. Click on the + icon to open the Add Artifact pane.

    add artifact

  5. Click + View More under Create an Integration.

  6. Click Endpoint under Other Artifacts to open the Endpoint Form.

  7. Select the endpoint type you want from the Endpoint Form.

    Endpoint form

  8. Enter a unique name for the endpoint.

  9. Specify values for the required parameters for the selected endpoint type.

  10. Click Create to save the endpoint configuration.

The endpoint will be created in the <PROJECT_NAME>/src/main/wso2mi/artifacts/endpoints folder under the integration project you created.

Design the integration

Note

Endpoints cannot be added directly to the integration sequence. Instead, they must be invoked using the Send Mediator or the Call Mediator.

Therefore, to add an endpoint artifact to the integration sequence, use the Send Mediator or the Call Mediator.

Follow the below steps to add the created endpoint to the integration flow:

  1. Open the Design View of your mediation sequence.
  2. Add the Call Endpoint mediator from the palette under All Mediators > Generic section to the relevant position in the mediation sequence:

    Select call endpoint

    Tip

    Similarly, you can use the Send Mediator instead of the Call Mediator.

  3. In the Call Endpoint form, select the endpoint you need to invoke under Select Endpoint. You can also select Create New to create a new endpoint artifact.

    Call endpoint

The endpoint artifact is now linked to your integration sequence.

Update the properties

You can use the Form view or the Source view to update endpoint properties.

To update from the Form View:

  1. Go to MI Project Explorer.
  2. Under Other Artifacts > Endpoints, select the endpoint that you need to update the properties. The Endpoint Form will be opened.
  3. Update the properties.
  4. Click Save Changes.

To update from the Source View:

  1. Go to MI Project Explorer.
  2. Under Other Artifacts > Endpoints, select the endpoint that you need to update the properties.
  3. Click on the Show Source (</>) icon located in the top right corner of the VS Code.

    Show source

    This will open the source view of the endpoint artifact.

    Endpoint source view

To learn more about all available endpoint properties, see the endpoint properties documentation.

Examples

Follow our examples on endpoints: