Skip to content

Create an Endpoint Template

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

Instructions

Create the endpoint template artifact

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

    Info

    Follow the Install Micro Integrator for VS Code documentation for a complete installation guide.

  2. Create an integration project.

  3. Go to Micro Integrator Project Explorer > Templates.

    Create endpoint template

  4. Hover over Templates and click the + icon that appears to open the Template Form below.

    Add-template

  5. This will open the Template Form shown below, where you can select the Template Artifact. Select the endpoint template type.

    Template form

    Note

    There are four Endpoint Templates available:

    • Address Endpoint Template
    • Default Endpoint Template
    • HTTP Endpoint Template
    • WSDL Endpoint Template

    This will open the respective Endpoint Form.

  6. Enter a unique name for the template.

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

  8. Also, update the endpoint parameter values with placeholders prefixed by $.

  9. Click Create.

    The template endpoint artifact is created in the src/main/wso2mi/artifacts/templates folder under the project you created.

Design the integration

Follow the steps below to add the already-created endpoint template to your mediation sequence.

  1. Go to MI Project Explorer > Endpoints.

  2. Hover over Endpoints and click the + icon that appears to open the below Endpoint Form.

  3. Select Template Endpoint from the set of available endpoints on the Endpoint Form.

    Endpoint form

  4. In the Template Endpoint Form, specify the values for the required properties.

  5. From the Template dropdown, select the endpoint template you created in a previous step.

  6. Click Create.

    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.

  7. Open the Design View of your mediation sequence.

  8. 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.

  9. In the Call Endpoint form, select the endpoint you need to invoke under Select Endpoint.

    Call endpoint

The endpoint template artifact is now linked to your integration sequence.

Update properties

You can update the properties you specified for the endpoint template later.

  1. From MI Project Explorer, select the endpoint template available under the available endpoint templates.

  2. Update the properties from the Template Artifact form.

  3. Click Save Changes.

Learn more about endpoint templates

Follow our examples on endpoint templates: