Skip to content

Exposing Non-HTTP Services as RESTful APIs

This example demonstrates how the WSO2 Micro Integrator forwards messages to non-HTTP endpoints.

Synapse configuration

Following is a sample REST API configuration that we can used to implement this scenario. See the instructions on how to build and run this example.

<api xmlns="" name="EventDelayOrderAPI" context="/orderdelayAPI"> 
        <resource methods="POST" url-mapping="/"> 
              <property name="REST_URL_POSTFIX" action="remove" scope="axis2"></property> 
                    <address uri=

When using a non-HTTP endpoint, such as a JMS endpoint, in the API definition, you must remove the REST_URL_POSTFIX property to avoid any characters specified after the context (such as a trailing slash) in the request from being appended to the JMS endpoint.

Notice that we have specified the REST_URL_POSTFIX property with the value set to "remove". When invoking this API, even if the request contains a trailing slash after the context (e.g., POST instead of POST, the endpoint will be called correctly.

Build and run

Create the artifacts:

  1. Set up WSO2 Integration Studio.
  2. Create an integration project with an ESB Configs module and an Composite Exporter.
  3. Create the rest api with the configurations given above.
  4. Deploy the artifacts in your Micro Integrator.

Configure the ActiveMQ broker with your Micro Intergrator.

Set up the back-end service:

  1. Download the back-end service
  2. Extract the downloaded zip file.
  3. Open a terminal, navigate to the axis2Server/bin/ directory inside the extracted folder.
  4. Execute the following command to start the axis2server with the SimpleStockQuote back-end service:


Invoke the REST API with a POST message.