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

  1. 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.

  2. 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.

  3. Java Business Service endpoint address
    http://localhost:9762/services/TradeServiceWsas

  4. Java Order Processor Service (with security) endpoint address
    http://localhost:9762/services/OrderProcessorMsec

  5. Java Order Processor Service (without security) endpoint address
    http://localhost:9762/services/OrderProcessor

  6. 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.

  7. 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.

  8. 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

  1. 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.

  2. 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.

  3. Spring Business Service endpoint address
    http://localhost:8070/StockTrader/services/TradeService

  4. Spring Order Processor Service (with security) endpoint address
    http://localhost:8060/StockTrader/services/OrderServiceMsec

  5. Spring Order Processor Service (without security) endpoint address
    http://localhost:8060/StockTrader/services/OrderService

  6. 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.

  7. 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.

  8. 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

  1. How to install WSF/PHP WAMP?
    Unzip the SOAWAMP.zip file to the c:\wso2 directory.

  2. How to Start WSF/PHP WAMP?
    Go to the c:\wso2\SOAWAMP directory and run Server_Start.bat

  3. PHP Business Service endpoint address
    http://localhost:8080/business_service/business_svc.php

  4. PHP Service (with security) endpoint address
    http://localhost:8080/order_processor/order_processor_svc_msec.php

  5. PHP Service (without security) endpoint address
    http://localhost:8080/order_processor/order_processor_svc.php

  6. PHP Client address
    http://localhost:8080/trader_client/login.php

  7. PHP Configuration Service
    http://localhost:8080/config_service/config_svc.php

  8. 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.

  9. 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.

  10. 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.

  11. 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.

  12. 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

  1. 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.

  2. How to start wso2mashup-stocktrader?
    Go to the c:\wso2\wso2mashup-stocktrader\bin directory and run startup.bat.

  3. Mashup Configuration Service User Interface endpoint address
    http://localhost:7762/services/admin/StockTraderConfig

  4. 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.