WSO2 Stock Trader - Installation Guide for preconfigured applications
WSO2 StockTrader is an online stock trading sample application with functionality equivalent to the Microsoft .NET Stock Trader sample benchmark application and IBM WebSphere's Trade 6.1 sample application. WSO2 StockTrader is powered by WSO2 WSF/PHP , WSO2 WSF/Ruby, WSO2 WSF/Perl, WSO2 WSF/Python, WSO2 WSF/Spring and WSO2 WSAS and implements the application in PHP, Ruby, Perl, Python, Spring and Java. It serves to illustrate interoperability between .NET, PHP, Ruby, Perl, Python, Spring and Java in deploying high-performance, scalable service oriented applications.
How to use WSAS Service
-
How to install
WSAS?
You should have JDK 1.5 installed. You can download it from here.
You also should install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
Set JAVA_HOME environment variable to the path where jdk is installed.
Unzip the wso2wsas-stocktrader.zip file to the c:\wso2 directory.
-
How to start WSAS?
Go to the c:\wso2\wso2wsas-stocktrader\bin directory and run wso2wsas.bat.
Go to https://localhost:9444 to see the admin console. Click on the services link on the left column to see the list of services.
- Java Business
Service endpoint address
http://localhost:9762/services/TradeServiceWsas
- Java Order
Processor Service (with
security) endpoint address
http://localhost:9762/services/OrderProcessorMsec
-
Java Order Processor
Service
(without
security) endpoint
address
http://localhost:9762/services/OrderProcessor
- Configure end
point address of configuration service
Edit the TradeServiceConfig.properties in c:\wso2\wso2wsas-stocktrader\lib\tomcat\webapps\ROOT\WEB-INF\classes and give end point address of configuration service.
- Configure
Database
for
Java service
Edit the mssql-db.properties in c:\wso2\wso2wsas-stocktrader\lib\tomcat\webapps\ROOT\WEB-INF\classes and give host IP, port, username and password of the MsSQL database.
-
Enable Logging
messages of Java Order Processor Services (Secure and Non-Secure)
Edit log4j.properties in c:\wso2\wso2wsas-stocktrader\conf and include following line
log4j.logger.org.wso2.stocktrader=DEBUG
How to use WSO2 WSF/Spring Service
- How to
install spring-stocktrader?
You should have JDK 1.5 installed. You can download it from here.
You also should install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
Set JAVA_HOME environment variable to the path where jdk is installed.
Unzip the spring-stocktrader.zip file to the c:\wso2 directory.
- How to start
spring-stocktrader?
Go to the c:\wso2\spring-stocktrader\SPRING_BS\bin directory and run startup.bat.
Go to the c:\wso2\spring-stocktrader\SPRING_OPS\bin directory and run startup.bat.
- Spring
Business
Service endpoint address
http://localhost:8070/StockTrader/services/TradeService
- Spring Order
Processor Service (with
security) endpoint address
http://localhost:8060/StockTrader/services/OrderServiceMsec
- Spring Order
Processor
Service
(without
security) endpoint
address
http://localhost:8060/StockTrader/services/OrderService
- Configure end
point address of configuration service
Edit the TradeServiceConfig.properties in c:\wso2\spring-stocktrader\SPRING_BS\webapps\StockTrader\WEB-INF\classes and give end point address of configuration service.
- Configure
Database
for spring business service
Edit the mssql-db.properties in c:\wso2\spring-stocktrader\SPRING_BS\webapps\StockTrader\WEB-INF\classes and give host IP, port, username and password of the MsSQL database.
- Configure
Database
for spring order processor service
Edit the mssql-db.properties in c:\wso2\spring-stocktrader\SPRING_OPS\webapps\StockTrader\WEB-INF\classes and give host IP, port, username and password of the MsSQL database.
How to use PHP Service
-
How to install
WSF/PHP
WAMP?
Unzip the SOAWAMP.zip file to the c:\wso2 directory.
-
How to Start WSF/PHP
WAMP?
Go to the c:\wso2\SOAWAMP directory and run Server_Start.bat
-
PHP Business Service
endpoint address
http://localhost:8080/business_service/business_svc.php
- PHP Service
(with
security) endpoint address
http://localhost:8080/order_processor/order_processor_svc_msec.php
-
PHP Service (without
security) endpoint
address
http://localhost:8080/order_processor/order_processor_svc.php
-
PHP Client address
http://localhost:8080/trader_client/login.php
- PHP
Configuration Service
http://localhost:8080/config_service/config_svc.php
- Configure
Database
for
PHP Order Processor service
Edit the database_config.xml in the c:\wso2\SOAWAMP\udrive\www\order_processor directory and give the host IP, port, username and password of the MsSQL database.
- Configure
Database
for
PHP Business service
Edit the database_config.xml in the c:\wso2\SOAWAMP\udrive\www\business_service directory and give the host IP, port, username and password of the MsSQL database.
- Configure
end point address of configuration service for Business service
Edit the configuration_service_config.xml in the c:\wso2\SOAWAMP\udrive\www\business_service directory and give the configuration service end point.
- Configure
Database
for Configuration service
Edit the database_config.xml in the c:\wso2\SOAWAMP\udrive\www\config_service directory and give the host IP, port, username and password of the MsSQL database. - Create tables
needed for configuration service
Go to c:\wso2\SOAWAMP\udrive\www\config_service folder. Run "Table Creation.sql" in the database to create new tables needed by configuration service. Run "InsertScript.sql" to populate end points of the services. If you want to change the ip or port of service end points, you can modify it in "Service" table of "StockTraderDB" database.
How to use WSO2 Mashup Configuration Service User Interface
- How to
install wso2mashup-stocktrader?
You should have JDK 1.5 installed. You can download it from here.
You also should install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
Set JAVA_HOME environment variable to the path where jdk is installed.
Unzip the wso2mashup-stocktrader.zip file to the c:\wso2 directory.
- How to start
wso2mashup-stocktrader?
Go to the c:\wso2\wso2mashup-stocktrader\bin directory and run startup.bat.
- Mashup
Configuration
Service User Interface endpoint address
http://localhost:7762/services/admin/StockTraderConfig
- Configure end
point address of configuration service
Edit the Stub.js in c:\wso2\wso2mashup-stocktrader\scripts\admin\StockTraderConfig.resources and give end point address of configuration service.