Stonehenge StockTrader, Java Installation Guide


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.

Prerequisite

  1. JDK 1.5

    You can download JDK 1.5 from here. Set JAVA_HOME environment variable to the path where JDK is installed.
  2. JCE

    Download and install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. 
  3. WSO2 WSAS

    You can download WSO2 WSAS from here. The version should be 2.3 or more.
  4. .NET Stock Trader 2.0

    You can download it from here.
  5. Enable TCP/IP Protocols of MSSQL server

    Open “SQL Server Configuration Manager” from Start->Programs->Microsoft SQL Server 2005->Configuration Tools-> SQL Server Configuration Manager. Enable TCP/IP and disable Named Pipes from protocols of your MSSQL server. (Note that, in following picture, MSSQLSERVER is the name of the SQL server. In your case, the name might be different)


    Open TCP/IP Properties by double clicking “TCP/IP”. Set “Listen All” to “Yes” in Protocol tab.



    From IP Address tab, disable “TCP Dynamic Ports” by leaving it blank and give a valid “TCP Port” so that MSSQL server will listen in that port. (We have used port 1433 in order processor services, so it is better to use that port)


    Similarly, enable TCP/IP from SQL Native Client Configuration and disable Named Pipes. Also, check whether the port is set correctly. (Port should be 1433)




    After finishing above settings, restart MSSQL Server.

Installing Java Stock Trader

Download Java Stock Trader from here and unzip it.
  1. Installing Business Service
    Go inside the folder "business_service". Copy the files inside “binary-files” (TradeServiceWsas.aar) to <WSAS Install directory>\repository\services. Copy the files inside "lib" (sqljdbc.jar) to <WSAS Install directory>\lib. Copy the files inside “config-files” (i.e. TradeServiceConfig.properties, sec.jks, security-policy.xml and mssql-db.properties) to <WSAS Install directory>\lib\tomcat\webapps\ROOT\WEB-INF\classes. After copying, edit mssql-db.properties (in <WSAS Install directory>\lib\tomcat\webapps\ROOT\WEB-INF\classes) and give IP and Port of the MSSQL server. You don't need to change user name, password or database settings.  If you want to change the end point address of configuration service, edit TradeServiceConfig.properties and give the end point.
  2. Installing Order Processor
    Go inside the folder "order_processor". Copy the files inside “binary-files” (i.e. OrderProcessor.aar and OrderProcessorMsec.aar) to <WSAS Install directory>\repository\services. Copy the files inside “config-files” (i.e. config-service.properties and mssql-db.properties) to <WSAS Install directory>\lib\tomcat\webapps\ROOT\WEB-INF\classes. After copying, edit mssql-db.properties (in <WSAS Install directory>\lib\tomcat\webapps\ROOT\WEB-INF\classes) and give IP and Port of the MSSQL server. You don't need to change user name, password or database settings. If you want to enable logging from Order Processor service, edit log4j.properties in <WSAS Install directory>\conf and include following line:
    log4j.logger.org.wso2.stocktrader=DEBUG
    Then start/restart WSAS and login. Goto Keystores and browse for sec.jks inside "keys" folder. Add that file to key store. (Password is "password").

Endpoint Addresses

These are the default endpoint addresses
  1. Business Service
    http://localhost:9762/services/TradeServiceWsas
  2. Non-secure Order Processor
    http://localhost:9762/services/OrderProcessor
  3. Secure Order Processor
    http://localhost:9762/services/OrderProcessorMsec