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.

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:

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

  1. Load the following features using the Transcript menu option 'Tools->Load/unload features...'
  2. Load the Web services 6.0.1 beta (download site here)
  3. Import the application 'AbxWebServicesQuickTestApp' from the library file .\import\quicktest.dat
  4. Load application AbxWebServicesQuickTestApp
  5. 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 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: 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.

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.

<?xml version="1.0"?> <definitions name="VASTWebServiceUddiExample" targetNamespace="urn:uddi-org:inquiry_impl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:uddi-inquiry="urn:uddi-org:inquiry" > <import namespace="urn:uddi-org:inquiry" location="http://www.uddi.org/wsdl/inquire_v1.wsdl"/> <service name="IBMPublicUddiInquiryService"> <documentation>VAST Web Service Uddi Example</documentation> <port name="IBMPublicUDDIInquiry" binding="uddi-inquiry:InquireSoap"> <soap:address location="http://www-3.ibm.com/services/uddi/inquiryapi"/> </port> </service> </definitions> 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:

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:

Packaging must be done from an XD passive image.