Overview

Apache Stonehenge WSAS StockTrader is one of the implementations of the Stonehenge StockTrader Sample Application. This document is designed to serve as a guide for installing the Apache Stonehenge WSAS StockTrader sample application. It assumes an audience of experienced developers with at least a limited conceptual knowledge of SOA.

Minimum System Requirements

Item

Minimum

RAM Size

256 MB

Processor

Pentium 800 MHz or higher



Table of Contents





Prerequisites

The following components are required for the application to function properly:

  • Java EE 5 SDK
  • Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files
  • WSO2 Web Services Application Server 3.1.2
  • WSO2 Identity Server 2.0.3
  • Microsoft SQL Server Express 2008
  • Microsoft SQL Server JDBC Driver
  • MySQL JDBC Driver
  • Maven 2.0.8+
  • Any Subversion Client

Installing Java EE 5 SDK

Java EE 5 SDK provides the necessary components to create and host enterprise Java applications. It includes the Glassfish application server which can also be used as a container for the Metro implementation of the Stonehenge StockTrader Sample Application.

To install Java EE 5 SDK (w/JDK and Glassfish):

  1. Follow the instructions in the Installing Java EE 5 SDK document in the Installing Common Prerequisites section of this wiki.

Installing Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files

To install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6, follow the instructions in the Installing Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6 document in the Installing Common Prerequisites section of this wiki.

Installing WSO2 Web Services Application Server 3.1.2

To install WSO2 Web Services Application Server 3.1.2:

  1. Download the ZIP archive of version 3.0 of WSO2 Web Services Application Server.
  2. Extract the contents of the folder contained within the archive to a new folder on your hard drive (e.g., C:\wsas).
  3. In a text editor, open C:\wsas\conf\transports.xml.
  4. Update the http, and https ports as follows:
    <transport name="http" class="org.wso2.carbon.server.transports.http.HttpTransport">
    <parameter name="port">9764</parameter> 
    <transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport">
    <parameter name="port">9444</parameter> 
    

Installing WSO2 Identity Server 2.0.3

WSO2 Identity Server implements the Passive STS functionality of the Stonehenge StockTrader Sample Application.

To install WSo2 Identity Server 2.0.3:

  1. Download the ZIP archive or version 2.0.3 of WSO2 Identity Server
  2. Extract the contents of the folder contained within the archive to a new folder on your hard drive (e.g., C:\wso2is)

Installing Microsoft SQL Server Express 2008

To install Microsoft SQL Server Express 2008, follow the instructions in the Installing Microsoft SQL Server Express 2008 document in the Installing Common Prerequisites section of this wiki.

Installing the jTDS - SQL Server and Sybase JDBC driver 1.2.2

To install the jTDS - SQL Server and Sybase JDBC driver 1.2.2:

  1. Download the ZIP archive for the jTDS - SQL Server and Sybase JDBC driver 1.2.2
  2. Extract jtds-1.2.2.jar to new folders created at C:\wsas\repository\lib and C:\wso2is\repository\components\lib

Installing the MySQL Connector/J 5.1.X

To install the MySQL Connector/J 5.1.X:

  1. Download the ZIP archive for the MySQL Connector/J 5.1.12
  2. Extract mysql-connector-java-5.1.12\mysql-connector-java-5.1.12-bin.jar to the folder C:\wsas\repository\lib and C:\wso2is\repository\components\lib

Installing Maven 2.2.1

To install Maven 2.2.1:

  1. Download the ZIP archive for Maven 2.2.1
  2. Extract the contents of the directory contained within the archive to a new directory on your hard disk (e.g., C:\maven)
  3. Add the following paths to your PATH environment variable:

    Description

    Example Path

    Maven binaries folder

    C:\maven\bin

Note

For more details about this procedure, please see: How to Set Environment Variables.

Installing a Subversion Client

To install a Subversion client, follow the instructions in the Installing a Subversion Client document in the Installing Common Prerequisites section of this wiki.

Installing the Apache Stonehenge StockTrader Application

Retrieving Source Code

To retrieve the source code, follow the instructions in the Retrieving the Source Code document in the Installing Common Prerequisites section of this wiki.

Preparing the Database

To intialize the database and create accounts:

  1. Follow the instructions in the Preparing the StockTrader Database document in the Installing Common Prerequisites section of this wiki.

To update WSAS endpoint configuration:

  1. In Microsoft SQL Server Management Studio, connect to your local SQL Server instance.
  2. In Object Explorer, expand the Databases > StockTraderDB > Tables node.
  3. Right-click the dbo.SERVICE table, and then click Edit Top 200 Rows.
  4. Update the rows where the SERVICENAME column begins with WSAS_ to use port 9764 instead of 9763.
  5. Close Microsoft SQL Server Management Studio.

Building from Source Code

  1. At a command prompt window, navigate to the C:\stonehenge\stocktrader\wsas directory.
  2. Type and execute the following command:
    mvn clean install
    

    Note

    This will create a directory named wsas_stocktrader under C:\stonehenge\stocktrader\wsas\target

  3. Copy the contents of the newly created wsas_stocktrader directory to C:\wsas
  4. In a text editor, open C:\wsas\webapps\ROOT\WEB-INF\classes\db.properties.
  5. Modify the values of the properties contained within to be appropriate for your target environment.

Running WSO2 Identity Server and Web Services Application Server

  1. At a command prompt window, execute the following command:
    C:\wsas\bin\wso2server.bat
    
  2. At a separate command prompt window, execute the following command:
    C:\wso2is\bin\wso2server.bat
    
  3. Leave both windows open.

Importing the Key stores into WSO2 Web Services Application Server

  1. In a browser, navigate to the following URL: https://localhost:9444/carbon
  2. Log-in with the user name admin and the password admin.
  3. In the left pane, under Configure, click Key Stores.
  4. Click Add New Key store.
  5. On the Add New Key store page, browse to and select C:\stonehenge\stocktrader\wsas\resources\conf\BS.jks
  6. In the Key store Password box, type yyy, and then click Next.
  7. On the following page, in in the Private key password box, type yyy, and then click Finish.
  8. Repeat this process for C:\stonehenge\stocktrader\wsas\resources\conf\OPS.jks with the password password.

Verify Endpoints

  1. In a browser, make sure that you can navigate to the following URLs successfully:

Configuring WSO2 Identity Server

  1. In a browser, navigate to https://localhost:9443/carbon
  2. Log-in using the user name admin, and the password admin.
  3. In the left pane, click the User Management link under Configure.
  4. On the User Management page, click the Add External User Store link.
  5. Add an external user store using the values shown in the table below:

    Property

    Value

    Connection URL

    jdbc:jtds:sqlserver://localhost:1433/stocktraderdb

    Conection user name

    trade

    Connection password

    yyy

    Driver name

    net.sourceforge.jtds.jdbc.Driver

    SQL for retrieving a given user's password

    select password from accountprofile where userid = ?

    SQL for listing users using "like"

    select userid from accountprofile where userid like ?

    SQL for selecting a single user given the user name

    select userid from accountprofile where userid = ?

    SQL for retrieving a user list

    select userid from accountprofile

  6. Click the Finish button when you are done.
  7. On the User Management page, in the External User Store section, click the Test Connection link.
  • No labels