The API manager Manager binary distribution comes with a certain number of samples , including APIs from Twitter, YouTube and Yahoo. Samples to demonstrate the API Manager's basic functionality. These samples are located in <PRODUCT_HOME>/samples folder. Inside this directory, you will find sub directories for each sample. Each sample comes with 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.
By default, the samples installation uses the admin user to create samples.
Configuring Libraries
You Before running the samples, ensure that the following are available:
- An HTTP client tool such as cURL (http://curl.haxx.se)
- A JavaScript compatible web browser
- An active Internet connection
Follow the instructions below to run any selected sample.
1. Download and install the API Manager according to the instructions given in the Installation Guide. Note that JDK 1.6.0_23 or higher and Apache ANT 1.7 or higher should be installed as mentioned in the Installation Prerequisites section.
2. Your need to configure various libraries before installing examples. To do this, you must run ant inside by typing "ant" from the <PRODUCT_HOME>/bin directory.
Installing the samples
To install the samples as the admin user:
1. Make sure the API manager is started
2. Execute the APIPopulator.sh script for each sample.
Starting and Stopping the API Gateway
To start the API manager product once you unzipped it, you only need to make sure you have a Java runtime at 1.6 level installed on your machine and the JAVA_HOME environment variable set. Then:
1. Open a command line window
2. Go to wso2am-1.0.0-ALPHA/bin
3. Start wso2server.bat or wso2server.sh
4. Wait until you see the message:
Code Block |
---|
[2012-06-20 14:47:16,905] INFO - StartupFinalizerServiceComponent Server : WSO2
API Manager-1.0.0-ALPHA
[2012-06-20 14:47:16,905] INFO - StartupFinalizerServiceComponent WSO2 Carbon
started in 40 sec
[2012-06-20 14:47:17,356] INFO - CarbonUIServiceComponent Mgt Console URL :
https://192.168.1.39:9443/carbon/ |
Info | ||||
---|---|---|---|---|
| ||||
For further installation guidance, check this video hosted on youtube:
|
5. To stop the API Gateway, simply hit Ctrl-C in the command window or choose Shutdown. Restart from the API Manager's Management Console. For more information on the console, refer to section Introducing the Management Console.For example, in Windows:
3. Start the API Manager according to the instructions given 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 <PRODUCT_HOME>/samples/Data directory.
Info | ||
---|---|---|
| ||
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.
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, performing the above procedure once is sufficient.
Excerpt | ||
---|---|---|
| ||
WSO2 API Manager Samples |