This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with the Microgateway in a Windows Environment
You can work with the WSO2 API Manager Microgateway in a Microsoft Windows environment as follows:
Before you begin
Make sure to have the following prerequisites in place to initialize a Microgateway instance,
- Oracle Java 1.8
- WSO2 API Manager (WSO2 API-M) 2.5.0 or later.
This is required to bootstrap the Microgateway. - WSO2 Microgateway CLI tool
- NSSM (the Non-Sucking Service Manager)
This is required if you need to run the Microgateway as a Windows service.
Running the Microgateway on a Windows operation system
Follow the steps below run a WSO2 API Manager Microgateway instance in a Windows environment.
Step 1 - Set up JAVA_HOME
You need to set up JAVA_HOME
in order to run the Microgateway CLI tool.
- Install the Oracle Java 1.8 or higher version.
- Set the
JAVA_HOME
environment variable as a user variable via the edit system properties UI.
Step 4 - Run the Microgateway
- Copy the <
micro-gw-project-name>.zip
file from the<project-name>\target
directory and extract the files to where you want to run the Microgateway. Navigate to the <
micro-gw-project-name>/bin
directory.cd <micro-gw-project-name>/bin
Run the Microgateway.
This runs the Microgateway instance in the foreground..\gateway.bat
Run the Microgateway as a Windows service
Step 1 - Set up JAVA_HOME
You need to set up Java in order to run the Microgateway CLI tool.
- Install Oracle Java 1.8 or later.
- Set the
JAVA_HOME
environment variable as a server variable via the edit system properties UI.
Step 4 - Install the Gateway script as a Windows service
- Download the NSSM (Non-Sucking Service Manager) tool and extract the ZIP file.
- Copy the extracted ZIP file to the location where you want to run the Microgateway.
- Install the
gateway.bat
script as a Windows service.Navigate to the
win64
folder, which is inside the new location of the extracted NSSM tool.cd apim_2_5_microgateway_bat\nssm-2.24\win64
Run the following command to install the
gateway.bat
script as a Windows service.nssm.exe install microgw
- Click Yes when the following User Account Control message appears.
You need to do this in order to allow the NSSM tool to make changes to your Microgateway distribution.
- Click [...] and select the location of the
gateway.bat
file, which is in the\bin
folder of your unzipped Microgateway distribution.
- Click Details, and enter the details of the Microgateway service.
- Click Install service.
A confirmation message appears.
Testing the Microgateway
You can invoke the API through the Microgateway using the following cURL command in order to test the Microgateway. By default, the Microgateway serves the HTTPS/WSS request via the 9095 port.
Resetting the Microgateway CLI tool
When you run the Microgateway CLI tool for the first time, it preserves all the information (i.e., your username, APIM base URL, TrustStore location and the TrustStore password) with the exception of your password, for later use. If you want to reset the Microgateway CLI tool in order to clear all the data that has been preserved by the Microgateway CLI tool, you can use the –reset
argument as follows. Note that you can invoke the Microgateway CLI tool reset command from any directory in the system.
micro-gw reset