VisualAge Smalltalk Web services Quick Tester
The Quick Tester demo is a simple but useful VisualAge Smalltalk application that allows users to perform a 'quick test' on deployed Web services. The demo utilizes information derived from WSDL to dynamically construct an appropriate user interface for any WSDL operation. At runtime, supplied inputs are serialized into SOAP messages and passed to the target service endpoint. By applying concepts from industry standards including SOAP 1.1, WSDL 1.0, and XML schema 1.0, VisualAge Smalltalk V6.0 (VAST) supplies a very flexible and pluggable platform for hosting and invoking Web services. The Quick Tester demo exploits the flexibility of the VAST Web services infrastructure by adding an HTML interface that enables invocation of properly described services built with any tool!
Configuring the Quick Tester application
The files vawcmast.gif and poweredBySST.gif must be copied from the .\htmlwrappers demo directory to a directory accessible by a web server. The application files that reference these gifs must be updated to reflect the new location. The vawcmast.gif file is referenced as the masthead for all of the .html files in the .\htmlwrappers directory. The poweredBySST.gif file is referenced only by deploy.html. Users can supply their own gif files to create a customized look for the Quick Tester.
By default, the Quick Tester application listens for HTTP requests on port 63003. If desired, the server port can be changed by modifying the configuration file wsistart.cfg in the base demo directory.
Starting the Quick Tester application
The batch file wstester.bat can be run from the command line or from the Windows Explorer. The batch file starts an HTTP server in VisualAge Smalltalk to enable execution of the Quick Tester application. After VisualAge Smalltalk is started, you can access the Quick Tester deployment page at the URL http://<myhost>:63003/AbtWebConnect/AbxWebServicesDeployPage.
Using the Quick Tester application
Deploying services
Deploy remote services to the VisualAge Smalltalk Web services platform by entering a valid WSDL URL name and clicking the 'Deploy WSDL' button. Deploying the remote service allows VAST to perform the initialization tasks required to properly invoke the operations of the service. You can start by deploying one or more of the WSDL resources listed below.
- http://webservices.matlus.com/scripts/WordFind.DLL/wsdl/IWordFind
- http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl
- http://www.vbws.com/services/weatherretriever.asmx?WSDL
If the WSDL deploys successfully, the WSDL URL is added to the 'Deployed WSDLs' drop down list and selected.
Invoking service operations
Select the WSDL URL that contains the desired operations:
- Click the 'Invoke operations' button to explore the operations provided by the service
- Select the desired operation, and click 'Build inputs' to construct an HTML table that contains the input arguments for the operation
- Supply values for all necessary inputs, and click the 'Invoke ' button to invoke the operation passing the supplied argument values
- When applicable, a '*' is placed next to those input arguments that are required as determined from the XML schema element definition
Enhancing the Quick Tester application
This section is useful for those who wish to use the VisualAge Smalltalk development environment to view and understand the source code for the Quick Tester application.
Loading the Quick Tester application
- Load the following features using the Transcript menu option 'Tools->Load/unload features...'
- ST: Server, Web Services
- VA: WebConnection for SST
- Load the Web services 6.0.1 beta (download site here)
- Import the application 'AbxWebServicesQuickTestApp' from the library file .\import\quicktest.dat
- Open application manager. From the System Transcript, select (Tools->Manage applications)
- Import the application (Applications->Import).
- Blank out the host name when prompted; use the file prompter to find the 'quicktest.dat' file and select it.
- Select AbxWebServicesQuickTestApp; select the listed version; and use the '>>' button to select the application for import
- If you intend to package the Quick Tester application for runtime deployment, import the application AbxWebServicesQuickTestPackagingApp
- Load application AbxWebServicesQuickTestApp
- From an 'Application Manager', select 'Load->Available...'
- Select the listed version of application AbxWebServicesQuickTestApp
- Save image using the Transcript menu option 'File->Save image'
Understanding the Quick Tester application
The Quick Tester application takes advantage of several of the powerful features included with VisualAge Smalltalk Version 6.0.
- The Web Services feature provides the infrastructure that enables the Quick Tester to deploy and invoke a wide variety of remote Web services with minimal coding
- The Web Connection feature is used to provide the user interface and application flow for the Quick Tester. HTML file wrappers are used to provide the visual layout for the various pages, and application session information is retained using the session data feature of Web Connection.
- Server Smalltalk (SST) provides the communications infrastructure that enables remote Web services to be easily invoked. Additionally, the HTTP server capabilities of SST are used to enable serving of Web Connection HTML pages
The Quick Tester application consists of two Web Connection parts, AbxWebServicesDeployPage and AbxWebServicesInvokeOperationsPage. These parts act as controllers that govern application flow and populate the HTML file wrapper that is to be returned to the browser. HTML file wrappers are classes that act as templates (similar to Java JSPs) to wrapper HTML files containing both static and dynamic content. Parameter markers in the HTML files are populated with dynamic content at runtime by controlling Web Connection parts . The particular HTML file wrapper to be returned to the browser can be set at runtime by setting the primaryPart of the Web Connection part to the appropriate wrapper instance.
Methods are categorized in the image as follows:
- Quick Tester - Web Services
- Methods that participate in the deployment and invocation of Web Services
- Quick Tester - HTML generation
- Methods that participate in the generation of dynamic HTML content
- Quick Tester - Internal
One of the very powerful features of VisualAge Smalltalk is the ability to extend the behavior of a class without the need to create a new subclass. Class extensions can be used to add new methods to an existing class without affecting its base definition. The Quick Tester exploits this capability by adding the method abxAddHtmlInputObjectsTo:context: to many of the XML schema classes. The extensions make it possible to walk the contents of an XML schema declaration allowing each element to append an appropriate HTML representation to the HTML element tree.
Starting the Quick Tester application in a development environment
Use the Web Server Interface Monitor user interface to start an sst-http server on a specified port.
- From the System Transcript, select 'Tools->Open Web Server Interface Monitor'
- Specify a transport of 'sst-http' and a port number of 63003 (or another port of your choosing)
- Click the 'Start' button to start an HTTP server on the specified port
After the 'sst-http' transport is started, you can access the Quick Tester deployment page at the URL http://myhost:63003/AbtWebConnect/AbxWebServicesDeployPage.
NOTE: The Transcript menu option 'Tools->Open Web Browser Launch Options' can be used to specify the URL path for Web Connection parts. Properly setting this option enables launching of Web Connection parts using the VisualAge Organizer test button.
Invoke UDDI using Quick Tester
The UDDI registry API is exposed as a Web service and WSDL containing interface information is provided. In order to deploy the service, you must create your own implementation WSDL as shown below and deploy it. Notice that the implementation WSDL imports an interface WSDL document containing the abstract UDDI service interface.
VAST Web Service Uddi Example
The UDDI service has various operations that demonstrate passing of complex parameter structures.
SST debugging tip
By default, the Server Smalltalk (SST) feature traps and handles exceptions (including breakpoints) that occur during request processing. To disable the default exception handling of SST, perform the tasks below:
- From the Transcript, select 'Tools->SST->Forward exceptions...'
- Select all items from the 'Enabled' list, and move them to the 'Disabled' list
- Click 'OK'
The VisualAge Smalltalk debugger will now open when breakpoints are encountered.
Packaging the Quick Tester
The provided runtime for the Quick Tester application demonstrates a recommended technique for packaging server applications in VisualAge Smalltalk. The general approach is that a platform is packaged which contains all common infrastructure necessary for executing a set of applications. Individual applications can then be packaged as separate components and deployed to the platform.
The application AbxWebServicesQuickTestPackagingApp contains packager instructions for:
- Building a platform image component that contains the Web Services and Web Connection base infrastructure code (sstwsqt.ic)
- Building a reusable image component that contains the Quick Tester application (abxqtest.ic)
Packaging must be done from an XD passive image.