VA Smalltalk Goodie:
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.2 (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.

<< Back to Top

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.

<< Back to Top

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. A collection of other various services can be found at http://www.xmethods.com.

If the WSDL deploys successfully, the WSDL URL is added to the 'Deployed WSDLs' drop down list and selected.

<< Back to Top

Invoking service operations

Select the WSDL URL that contains the desired operations:

<< Back to Top

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. Add the DefaultFilePath entry to the [Html File Wrappers] stanza of the VisualAge .ini file (as shown below) to specify the file path for the htmlwrapper files installed with the Quick Tester goodie. [Html File Wrappers] DefaultFilePath=.;d:\goodies\wstester\htmlwrappers\;
  2. Load the following features using the Transcript menu option 'Tools->Load/unload features...'
  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'
  6. << Back to Top

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.

<< Back to Top

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.

  1. From the System Transcript, select 'Tools->Open Web Server Interface Monitor'
  2. Click the 'Start a WSI Server...' button.
  3. Specify a transport of 'sst-http' and a port number of 63003 (or another port of your choosing)
  4. 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.

<< Back to Top

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.

<< Back to Top

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.

<< Back to Top

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 to:

Packaging must be done from an XD passive image.

<< Back to Top

Packaging and deploying the Quick Tester as an NT service

Packaging the NT service

The VAST Quick Tester download includes packaging instructions for packaging the Quick Tester application as an NT service. Following are the steps for building the VAST Quick Tester NT Service:

Deploying the NT service

  1. Add the \wstester\bin directory to your permanent system PATH, or copy all DLL and EXE files from the \wstester\bin directory to a directory that already exists in the PATH. NOTE: If you add a new directory to the system PATH, you may need to reboot to activate the change.
  2. Go to the \wstester\service directory and execute the register.bat file. This will add the service 'VAST Quick Tester' to the Windows service collection. It may be necessary to edit the register.bat file before executing in order to properly specify the srvWorkingDir argument. The value should be the directory where the runtime image is located.
  3. Go to Windows "Services" panel and start the service. Errors during service start up are typically due to the absence of required executable files from the system PATH. Modifications to the PATH may not be active until the computer is restarted. Information about application problems is written to the file sstwsqt.log in the startup directory.
  4. Verify that the service is active. Go to a Web browser, and enter the URL -- http://hostname:63003/AbtWebConnect/AbxWebServicesDeployPage
  5. Customize the service definition if desired. It may be desirable to automatically start the service whenever the computer is restarted.
  6. If you wish to remove the service, use the unregister.bat file in the .\wstester\service directory.

<< Back to Top

Disclaimer(s)

license

(C) Copyright IBM Corporation 1995, 2003. All rights reserved.