Web services Guide


Creating a Web service in VisualAge Smalltalk

The VisualAge support for Web services provides the infrastructure necessary to invoke application behavior in loosely-coupled, heterogeneous computing environments. Creating the application logic for a Web service is no different than creating application logic for any standard server application. In fact, it should be easy to expose the functionality of existing server applications as Web services. The VisualAge Web services support provides a communications layer to manage the interchange of data between clients and servers using the SOAP message format. The key to the successful deployment of an application as a Web service is creating the service definition files required to describe the service. Below is a list of the files used by the VisualAge Web services support.


Table 1. VisualAge Web Service deployment files

File type File description
Deployment descriptor An XML document that describes all program resources required during the lifecycle of a service:
  • The location of the WSDL file that describes the service
  • List of image components to be loaded during deployment
  • List of the mapping specification files
  • List of service handlers
  • The implementor of the service (the name of a class)
  • Method mappings
  • List of service descriptions containing the following information:
    • name and namespace for the service
    • service class (usually SstWSService)
    • provider information. The provider defines the following:
      • Class that implements the service and the creation method for the class
    • List of operations supported by the service along with the mechanism for handling the operation. Operations can be handled by a invoking a method in the provider class or by specifying a custom service handler. Service handlers are described in the "Web services Handlers" section.
WSDL files An XML document that describes the public interface for a service. Supported operations, parameter descriptions, and network endpoint information are some of the items that are described by the WSDL document.
Mapping file An XML document used to specify rules for mapping XML document elements into Smalltalk classes.

A simple file generation tool is provided which constructs the necessary web service deployment files using information retrieved from a Smalltalk class. To use the tool, determine which methods are to be exposed as operations in the service interface, and add those methods to the method category '@WS-API'. Run the code below to create generalized deployment files for the service.

	SstWSXmlGeneration  forClass: SstWSInsurancePolicyInterface

For most cases, the deployment files will require modification prior to usage to reflect the proper settings for a specific installation. The files are named as shown below.

  1. <class name>'.wsdl' (WSDL implementation document)
  2. <class name>'-interface.wsdl' (WSDL interface document)
  3. <class name>'.xml' (VisualAge Smalltalk web service deployment descriptor)

These files will be placed in the directory specified by the key DefaultResourceQualifier located in the XML stanza of the abt.ini file. If this key is not found, then they will be placed in the image startup directory (CfsDirectoryDescriptor startUpDirectoryPath). It is important to remember that these files will be OVERWRITTEN if they exist!

The next section will describe how to go about deploying a web service.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]