 | Warning
This page is a draft, its content is not complete and might contain errors. |
Overview
This document is meant to serve as a guide for installing the Metro version of the Stonehenge StockTrader Sample Application. It also includes a series of test cases that you can work through to demonstrate interoperability with other implementations of the application.
Vocabulary
Metro StockTrader Deployment
Prerequisites
- Update JCE settings
- Go to http://java.sun.com/javase/downloads/?intcmp=1281
- Download Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6
- Extract the files included in jce_policy-6.zip in the %JAVA_HOME%\jre\lib\security directory, overwriting the files already present in the directory.
 | Note
If you use JDK 1.5, you will need to install the files for JDK 1.5 |
- Check Out StockTrader Source Code
- Check out the Metro implementation of the StockTrader sample application from http://svn.apache.org/repos/asf/incubator/stonehenge/trunk/stocktrader/metro/.
- Add Dependent JAR Files to StockTrader
- Create a lib folder under STOCKTRADER_HOME, and then download the dependencies listed in the README.TXT file in the STOCKTRADER_HOME directory.
- Install GlassFish
- Download GlassFish 2.1 from http://glassfish.dev.java.net/
- Install GlassFish
 | Note
Once you have downloaded GlassFish, you can use the following commands to accomplish this task:
java -jar glassfish.jar
cd glassfish
lib\ant\bin\ant -f setup.xml
Replace glassfish.jar with the name of the JAR file downloaded. |
- Set Environment Variables
- Set AS_HOME to the root directory of the glassfish installation.
- Set the Address of the StockTrader Configuration Service
- Open the file STOCKTRADER_HOME\resources\conf\TradeServiceConfig.properties
- Change the value of org.apache.stonehenge.stocktrader.TradeConfigService.url to the endpoint address of the configuration service that will be used.
 | Note
You could use the configuration service from either the Metro or .NET implementation. |
- Configure the Database Properties
- Open the file STOCKTRADER_HOME\resources\conf\db.properties
- Modify the values of the properties contained within to be appropriate for your target environment.
Deployment
- Deploy the StockTrader Application
 | Note
You can use the following command to accomplish this task:
STOCKTRADER_HOME\ant deploy
This assumes that you have installed Apache Ant, and have added its bin directory to the path. |
- Start GlashFish Server
 | Note
You can use the following command to accomplish this task:
%AS_HOME%\bin\asadmin.bat start-domain
By default GlassFish Server will be set up to listen on port 8080. You will have to reconfigure GlassFish to listen instead on port 8090. This can be configured by accessing the GlassFish Administration Console and logging in using the user name admin and the password adminadmin. |
- Verify Deployment
- To verify deployment of the BS, access http://localhost:8090/business_service/TradeServiceWsas?wsdl
- To verify deployment of the OP, access http://localhost:8090/order_processor/OrderProcessor?wsdl, and http://localhost:8090/order_processor/OrderProcessorSec?wsdl
- To verify deployment of the Configuration Service, access http://localhost:8090/config_service/ConfigService?wsdl
- To verify deployment of the UI Client, access http://localhost:8090/trader_client
Metro StockTrader Configuration
The Metro Services are managed through the StockTradeDB database. After you run the MSSQL database scripts, you will have four new tables (DBCONFIG, CLIENTTOBS, BSTOOPS, and SERVICE), which are used to configure the services for Metro.
Before you change the CLIENTTOBS and BSTOOPS configuration, open the SERVICE table and verify that the endpoint addresses are accurate for your environment. For this walk-through you will need to have the following endpoints:
| Service Name |
Default Value |
| DOTNET_BS |
http://localhost:9000/TradeBusinessService |
| DOTNET_OPS |
http://localhost:8000/TradeOrderProcessor |
| DOTNET_OPSSEC |
http://localhost:8000/TradeOrderProcessor/sec |
| METRO_BS |
http://localhost:8090/business_service/TradeServiceWsas |
| METRO _OPS |
http://localhost:8090/order_processor/OrderProcessor |
| METRO _OPSSEC |
http://localhost:8090/order_processor/OrderProcessorSec |
| PHP_BS |
http://localhost:8080/php_stocktrader/business_service/business_svc.php |
| PHP_OPS |
http://localhost:8080/php_stocktrader/order_processor/order_processor_svc.php |
| PHP_OPSSEC |
http://localhost:8080/php_stocktrader/order_processor/order_processor_svc_msec.php |
| WSAS_BS |
http://localhost:9763/services/TradeServiceWsas |
| WSAS_OPS |
http://localhost:9763/services/OrderProcessor |
| WSAS_OPSSEC |
http://localhost:9763/services/OrderProcessorMsec |
 | Note 1
For METRO_BS, METRO_OPS and METRO_OPSSEC, you should change the endpoint addresses according to the GlassFish development environment, making sure to include the correct port. |
 | Note 2
In the SERVICE table, please insert service names and addresses for WSAS, including WSAS_BS, WSAS_OPS and WSAS_OPSSEC. |
To configure the Services of BS and OPS
- Open the Metro StockTrader Client by accessing http://localhost:8090/trader_client.
- In the Toolbar, click the Config tab to access the Configuration Page.
- Select the corresponding BS and OPS, and then click the Set button.
Test Scenario
- Login to the StockTrader Client UI
- Click the Quotes/Trade tab in the toolbar.
- Choose a stock, and then in the Trade column, click the Buy link for that stock.
- Enter a quantity of 112 for Number of Shares, and then click Buy
- A submitted for processing message should be received.
- Click the Account tab in the toolbar.
 | Note If the OPS has processed the order, a Trade Alert should be appear |
Test Cases
- JSF Client as StockTrader UI to Talk to Specific Version of BS
Set the BS and OPS to the version to be used in Config page.
- Metro StockTrader as BS and OP via BasicHttpBinding
Set the BS and OPS as METRO_BS and METRO_OPS
- Metro StockTrader as BS and OP via CustomBinding
Set the BS and OPS as METRO_BS and METRO_OPSSEC
- Metro StockTrader as BS and .NET StockTrader as OP via BasicHttpBinding
Set the BS and OPS as METRO_BS and DOTNET_OPS
- Metro StockTrader as BS and .NET StockTrader as OP via CustomBinding
Set the BS and OPS as METRO_BS and DOTNET_OPSSEC
- Metro StockTrader as BS and WSAS StockTrader as OP via BasicBinding
Set the BS and OPS as METRO_BS and WSAS_OPS
- Metro StockTrader as BS and WSAS StockTrader as OP via CustomBinding
Set the BS and OPS as METRO_BS and WSAS_OPSSEC
- Metro StockTrader as BS and PHP StockTrader as OP via BasicBinding
Set the BS and OPS as METRO_BS and PHP_OPS
- Metro StockTrader as BS and PHP StockTrader as OP via CustomBinding
Set the BS and OPS as METRO_BS and METRO_OPSSEC
- .NET StockTrader as BS and Metro StockTrader as OP via BasicHttpBinding
Set the BS and OPS as DOTNET_BS and METRO_OPS
- .NET StockTrader as BS and Metro StockTrader as OP via CustomBinding
Set the BS and OPS as DOTNET_BS and METRO_OPSSEC
- WSAS StockTrader as BS and Metro StockTrader as OP via BasicHttpBinding
Set the BS and OPS as WSAS_BS and METRO_OPS
- WSAS StockTrader as BS and Metro StockTrader as OP via CustomBinding
Set the BS and OPS as WSAS_BS and METRO_OPSSEC
- PHP StockTrader as BS and Metro StockTrader as OP via BasicHttpBinding
Set the BS and OPS as PHP_BS and METRO_OPS
- PHP StockTrader as BS and Metro StockTrader as OP via CustomBinding
Set the BS and OPS as PHP_BS and METRO_OPSSEC
- .Net StrockTrader use Metro version config service
Set config service endpoint address to metro version config service.