This version of the Smalltalk Exchange application demonstrates the invocation of a VisualAge Smalltalk server application from a Java client via Web services. You must have the VisualAge Smalltalk Web services beta 0.40 loaded in order to use this demo.
The functionality of the application is broken down into 2 components.
The web browser interface is constructed using HTML and JSP files that invoke Java servlets on the application server. The Java servlets are used to route requests to Smalltalk Exchange via Web services requests. The Java Web service client stubs were constructed using Axis Apache 1.0. Be sure to follow all installation instructions for Apache Axis. Make sure that all required .jar files are copied to the correct directory on the application server. Be aware that the Apache Axis installation requires a separately downloadable JAXP-1.1 XML parser. We used the 'xerces.jar' with timestamp (04/11/ 2002 10:05AM). Visit the Xerces web site to download a recent copy of Xerces if necessary.
Below is a summary of the steps required to generate the Java client proxy classes. This is only necessary as an exercise. The generated Java client code (source and executable) is included as part of the demo package in the web archive file .\goodies\SmalltalkExchange\java\vastock_axis.war.
com.ibm.vast.stockdemo.* | Manually coded servlets and helper classes to web enable the Smalltalk Exchange |
com.VaStockWebService.www.* | Communications classes to manage HTTP interaction with Smalltalk Exchange remote service. This package was generated by the WSDL2Java tool |
com.vast.www.* | Model classes generated by the WSDL2Java tool. |
The operations supported by the Smalltalk Exchange server are found in an interface class named VaStockWebService. Based upon methods with category name @WS-API, various Web service resource files were constructed to externally describe the interface for the Smalltalk service. The required Web services files were initially generated using the SstWSXmlGeneration tool. Customization of files was necessary to properly describe the Smalltalk types and provide accurate endpoints. A summary of commonly required customizations is included in the VisualAge Smalltalk Web Services Guide. Below is a summary of the external resources used by the Smalltalk Exchange Web service.
VaStockWebService.xml | An XML deployment descriptor document containing resources and rules for deploying the Smalltalk Exchange service |
VaStockWebService.wsdl | A WSDL document that describes the endpoints for the Smalltalk Exchange service and imports a separate WSDL document containing information about the supported service operations. |
VaStockWebService-interface.wsdl | A WSDL document that describes the abstract interface for the Smalltalk Exchange service including parameter descriptions and encoding rules. |
vastock.xsd | An XML schema that describes the structure of the arguments required by supported operations |
vastockws.map | A Smalltalk mapping specification used to resolve naming disparities between Smalltalk class names and attributes and their XML schema counterparts. |
wsserver.wks | A Smalltalk workspace used to start an HTTP server and deploy the Smalltalk Exchange service |
This section discusses the steps required to configure the Smalltalk Exchange application for execution under Tomcat or IBM WebSphere Application Server.
Before setting up the demo, you must first download and install the Apache Axis 1.0. The generated Axis client stubs reference the HTTP URL http://vasthost:63003/SstWSServlet; therefore, you must add an entry to the web server's hosts file to associate vasthost with the IP address of the machine where the Smalltalk Exchange server runs.
The server automatically expands the contents of the vastock_axis.war file during startup. All required resources should be in place after the server has successfully started.
Users of WebSphere 4.x can use the IBM WebSphere Application Server Adminstrative Console to configure the Java portion of the demo.
Path | Specify the file .\goodies\SmalltalkExchange\java\vastock_axis.war. Use Browse... button if necessary to locate the file |
Application Name | Smalltalk Exchange |
Context Root | /vastock_axis |
After the web application is successfully installed, the following Java resources will be available:
LoginServlet | com.ibm.vast.stockdemo.LoginServlet |
LogoutServlet | com.ibm.vast.stockdemo.LogoutServlet |
QueryServlet | com.ibm.vast.stockdemo.QueryServlet |
TransactionServlet | com.ibm.vast.stockdemo.TransactionServlet |
Loading VisualAge Smalltalk code
Below is a summary of the configuration maps defined for the Smalltalk Exchange application along with the prerequisite VisualAge features. Make sure prerequisite features are loaded prior to attempting to load the Smalltalk Exchange maps.
Map name | Contents | Prerequisites |
Goodies - Smalltalk Exchange Web service | Master map for maintaining version information for all Smalltalk Exchange maps | ST: Server, Web Services, VA: XML support |
VaStockPortfolioBase | Model classes and general application behavior | ST: Server, Web Services, VA: XML support |
VaStockPortfolioWebService | Code to enable stock portfolio operations as Web service | VaStockPortfolioBase |
Running the application
Quotes are retrieved from an ObjectDumper file called vastock.listings. Saved stock prices may not closely match the actual market value. The file was constructed long ago when the stock market was thriving, and investors were happy! Below is the list of saved ticker symbols.