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):
- 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:
- Download the ZIP archive of version 3.0 of WSO2 Web Services Application Server.
- Extract the contents of the folder contained within the archive to a new folder on your hard drive (e.g., C:\wsas).
- In a text editor, open C:\wsas\conf\transports.xml.
- 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:
- Download the ZIP archive or version 2.0.3 of WSO2 Identity Server
- 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:
- Download the ZIP archive for the jTDS - SQL Server and Sybase JDBC driver 1.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:
- Download the ZIP archive for the MySQL Connector/J 5.1.12
- 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:
- Download the ZIP archive for Maven 2.2.1
- Extract the contents of the directory contained within the archive to a new directory on your hard disk (e.g., C:\maven)
- 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:
- Follow the instructions in the Preparing the StockTrader Database document in the Installing Common Prerequisites section of this wiki.
To update WSAS endpoint configuration:
- In Microsoft SQL Server Management Studio, connect to your local SQL Server instance.
- In Object Explorer, expand the Databases > StockTraderDB > Tables node.
- Right-click the dbo.SERVICE table, and then click Edit Top 200 Rows.
- Update the rows where the SERVICENAME column begins with WSAS_ to use port 9764 instead of 9763.
- Close Microsoft SQL Server Management Studio.
Building from Source Code
- At a command prompt window, navigate to the C:\stonehenge\stocktrader\wsas directory.
- Type and execute the following command:
mvn clean install
Note
This will create a directory named wsas_stocktrader under C:\stonehenge\stocktrader\wsas\target
- Copy the contents of the newly created wsas_stocktrader directory to C:\wsas
- In a text editor, open C:\wsas\webapps\ROOT\WEB-INF\classes\db.properties.
- Modify the values of the properties contained within to be appropriate for your target environment.
Running WSO2 Identity Server and Web Services Application Server
- At a command prompt window, execute the following command:
C:\wsas\bin\wso2server.bat
- At a separate command prompt window, execute the following command:
C:\wso2is\bin\wso2server.bat
- Leave both windows open.
Importing the Key stores into WSO2 Web Services Application Server
- In a browser, navigate to the following URL: https://localhost:9444/carbon
- Log-in with the user name admin and the password admin.
- In the left pane, under Configure, click Key Stores.
- Click Add New Key store.
- On the Add New Key store page, browse to and select C:\stonehenge\stocktrader\wsas\resources\conf\BS.jks
- In the Key store Password box, type yyy, and then click Next.
- On the following page, in in the Private key password box, type yyy, and then click Finish.
- Repeat this process for C:\stonehenge\stocktrader\wsas\resources\conf\OPS.jks with the password password.
Verify Endpoints
- In a browser, make sure that you can navigate to the following URLs successfully:
Description
Endpoint
Business Service
http://localhost:9764/services/TradeServiceWsas?wsdl Order Processing Service
http://localhost:9764/services/OrderProcessor?wsdl Order Processing Service (SEC)
http://localhost:9764/services/OrderProcessorMsec?wsdl
Configuring WSO2 Identity Server
- In a browser, navigate to https://localhost:9443/carbon
- Log-in using the user name admin, and the password admin.
- In the left pane, click the User Management link under Configure.
- On the User Management page, click the Add External User Store link.
- 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
- Click the Finish button when you are done.
- On the User Management page, in the External User Store section, click the Test Connection link.