Samples Setup
Introduction
This page gives generic setup instructions and prerequisites to run API Manager samples.
Note
This basic setup needs to be performed only once for a single API Manager installation. If you want to try multiple samples on the same installation, executing the following steps once is sufficient.
The API Manager binary distribution comes with a number of samples to demonstrate API Manager's basic functionality. These samples are located in $AM_HOME/samples folder. Inside this directory, you will find sub directories for each sample. Each sub directory contains the relevant configurations, scripts and instructions required to run the relevant sample. Each sample contains an APIPopulator script, which drives the API Manager via a REST API.
Prerequisites
- Java Development Kit/JRE version 1.6.* or 1.7.*
- Apache Ant 1.7.0 or later.
- An HTTP client tool such as cURL (http://curl.haxx.se).
- A JavaScript compatible web browser.
- An active Internet connection.
JDK and Ant setup instructions are given in section Installation Prerequisites.
Setting up Samples
1. Download and install the API Manager according to the instructions given in Installation Guide.Â
2. Before installing samples, there are various libraries to be configured. Run ant by typing "ant" from the $AM_HOME/bin directory in a command prompt (onWindows) or text Linux console (on Linux).
For example, on Windows:
3. Start the API Manager by executing $AM_HOME/bin/wso2server.bat (on Windows) or  $AM_HOME/bin/wso2server.sh (on Linux). More information can be found in section Running the API Manager. This will populate master data required for the server to start up.Â
4. Next, shut down the API Manager and run 'ant' inside $AM_HOME/samples/Data directory.
Â
Note
It is necessary to shut down the server before running ant in this case.
5. You will see an output similar to following.
It executes the UserPopulator.sql which creates two user accounts as "provider1" and "subscriber1", which can be used to log-in to the API Publisher and API Store respectively.
6. Start the WSO2 API Manager again and log in to the API Publisher (http://localhost:9763/publisher) using username/password as provider1/provider1. Similarly, you should be able to log in to the API Store (https://localhost:9443/store) using username/password as subscriber1/subscriber1.