This document is meant to serve as a guide for exploring the interoperability of the Apache Stonehenge project. This document will walk the developer through the process of configuring the different modules to consume business services and order processing services on different frameworks.
This document assumes an environment based on a single Windows 2008 Server running all the components of the Stonehenge project. In a real world environment this application would most likely be distributed across multiple servers. Throughout this document we will refer to the services using their localhost:{port number} addresses; if your configuration is distributed over several machines, or differs otherwise, please change the localhost designation to the proper machine/host name.
In order to perform the tasks in this guide, you will need to have the different components installed. Please make sure that you completed the guides on the StoneHenge wiki.
The .NET, PHP and WSAS Services are managed through the StockTradeDB database. After you run the .NET Setup or the PHP database scripts you will have four new tables (DbConfig, ClientToBs, BsToOps, and Service), which are used to configure the services for .NET/PHP/WSAS.
Before you change the ClientToBs and BsToOps configuration open the Service tables 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 |
JAVA_BS |
http://localhost:9763/services/TradeServiceWsas |
JAVA_OPS |
http://localhost:9763/services/OrderProcessor |
JAVA_OPSSEC |
http://localhost:9763/services/OrderProcessorMsec |
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 |
In the above service names BS stands for Business Service, OPS stands for Order Processing Service, and OPSSEC stands for Order Processing Service with Secure messaging. Throughout the remainder of this document the abbreviations BS and OPS will refer to the Business Service and Order Processing Service respectively. OPS will be used to refer to OPS or OPSSEC depending on your configuration. |
In this edition of the interop guide WSAS is the only JAVA implementation and the two terms may be used interchangeably. |
To configure the .NET Client and Business Service
To configure the PHP Client
To configure the PHP Business Service
To configure the WSAS Business Service
In addition to the Business Service and the Order Processing Service, both the PHP and the .NET StockTrader websites have a Configuration Service. This configuration service is used to pull the data from the database and determine which services to use in real-time.
The .NET Configuration Service is setup and built with the other .NET services, as a console app. When you run RunServices.bat you should notice the Configuration Service console appears first, with a short test for the .NET configuration. The test should display the current configuration present in the database. If the test shows up as green, the Configuration Service is able to connect to the database and retrieve configuration information accurately. If it shows up as red, then either the Configuration Service has not compiled correctly (open up ConfigServiceSolution and rebuild this) or it is unable to find the required information from the database (check that you have completed Step 3 of the .NET Installation Guide and that the database contains the configuration tables mentioned above, with rows in CLIENTTOBS for DOTNET_CLIENT and in BSTOOPS for DOTNET_BS).The configuration for the .NET client is all accessed from the front-end through the Configuration tab in the user interface.
To setup the PHP Configuration Service you will need to ensure that the resources\conf\database_config.xml file has the proper database connection information. Additionally, you will need to set the configuration service endpoint address under the Config tab of the PHP website. The default is http://localhost:8080/php_stocktrader/config_service/config_svc.php. For more information on setting up the PHP configuration see the install guide in the Prerequisites section.
Now that you are familiar with the configuration for the different services we are going to walk through the different configurations. Since all the services are communicating with the same database you will be able place an order in the .NET StockTrader website then sell the same order from the PHP website.
In order to get started you should open and run all the services. Please follow these steps to start all the services and websites.
If you have trouble running any of these services or websites please refer back to the installation guides in the Prerequisite section before continuing. |
The Stonehenge application provides, and this paper has documented, a full end-to-end service oriented application that allows for interoperability between different platforms. With the implementation of the WS-* Standards, developers get the benefit of distributed applications and platforms, while retaining reliable and secure messages between systems. This opens the door for technologies to co-exist in today's enterprise environments.
The Stonehenge project hopes to continue to develop example applications that use the standards currently defined by the W3C and OASIS protocols. As always, the Apache Foundation encourages contributions. For more information about the project, please see our proposal at http://wiki.apache.org/incubator/StonehengeProposal.