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¶
-
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.
-
Create an integration project.
-
To add a new Endpoint Template, navigate to MI Project Explorer.
-
Click on the + icon to open the Add Artifact pane.
-
Click + View More under Create an Integration.
-
Click Template under Other Artifacts to open the Template Form.
-
This will open the Template Form shown below, where you can select the Template Artifact. Select an endpoint template type.
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.
-
Enter a unique name for the template.
-
Specify values for the required parameters for the selected endpoint type.
-
Also, update the endpoint parameter values with placeholders prefixed by
$
. -
Click Create.
The template endpoint artifact is created in the
<PROJECT_NAME>/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.
-
Go to MI Project Explorer.
-
Click on the + icon to open the Add Artifact pane.
-
Click + View More under Create an Integration.
-
Click Endpoint under Other Artifacts to open the Endpoint Form.
-
Click + View More.
-
Select Template Endpoint from the set of available endpoints on the Endpoint Form.
-
In the Template Endpoint Form, specify the values for the required properties.
-
From the Template dropdown, select the endpoint template you created earlier.
-
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.
-
Open the Design View of your mediation sequence.
-
Add the Call Endpoint mediator from the palette under All Mediators > Generic section to the relevant position in the mediation sequence:
Tip
Similarly, you can use the Send Mediator instead of the Call Mediator.
-
In the Call Endpoint form, select the endpoint you need to invoke under Select 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.
-
From MI Project Explorer, select the endpoint template available under the available endpoint templates.
-
Update the properties from the Template Artifact form.
-
Click Save Changes.
Examples¶
Follow our examples on endpoint templates: