Web services Guide

Packaging a Web service

VisualAge Web services are modular software components. Therefore, properly designed services are well-suited for deployment as VisualAge Smalltalk image components. This section describes how to use the VisualAge packager to construct a Web services "platform" capable of dynamically deploying and hosting multiple Web services. Once the platform is constructed, it is simple to create image components that contain individual Web services. These services can be then deployed at runtime to the Web services platform image. For applications that cannot be easily structured as image components, the reduced runtime packaging strategy is also supported. See the following table for further information on packaging guidlines:

Table 2.


WS Platform (with IC's) Reduced Runtime
Headless Server Recommended Supported
UI Client Supported Recommended
MVS Servers Not Supported Recommended

Building a Web services platform

This section supplements materials on packaging into image components (ICs) in the IBM Smalltalk User's Guide.

The Web services feature includes a collection of reusable image components, which can be used to construct a Web services platform image component. The Web services platform must be constructed as a "leaf" image component in order to be startable. At a minimum, the packager specifications for the Web services platform IC should include the Web services reusable image component. Other applications and image components can be included in the leaf image component at package time; however, creating a minimal Web services start up image component is recommended to provide more versatility. Commonly used image components can be dynamically loaded at runtime by listing them in the <imageComponentUrls> section of the container deployment descriptor.

Building a service image component

Individual services that are to be deployed to the Web services platform should be packaged as reusable image components. Doing so allows these services to be dynamically loaded into a Web services platform at runtime instead of including them in the Web services platform image. See the User's Guide section "Creating a reusable and a leaf IC" for detailed information about building reusable image components.
Platform Overview with IC's

Packaging Web services clients

No special steps are required when building client images that utilize VisualAge Smalltalk Web services support. Follow the instructions in the Smalltalk User's Guide.

Packaging the Web services platform from an XD passive image

For services that are to be deployed as image components, you should begin by constructing a headless Web services platform image.

To do this, you must first construct an XD passive image for the target operating system. (See the server guide for information about building a passive image).

An example packager instruction class is provided to assist in building the headless Web service platform. The instructions below describe how to build the platform using the example packager instructions.

Packaging the Web services insurance example as a reusable image component (XD passive image)

Verify that the applications SstWebServicesInsuranceExample and SstWebServicesInsuranceExampleWSExtensions are loaded into the image where packaging will occur. These examples are not automatically loaded into passive images with the Web services feature.

Reduced runtime packaging

Some organizations may prefer to use the reduced runtime approach to runtime packaging. While this approach limits runtime flexibility in deployment and loading of services, it may offer a simpler technique for packaging less sophisticated service architectures.

When specifying the 'Applications and Ics' to be included in the packaged image, be sure to include the applications that comprise your service as well as the Web services support base application SstWebServicesHttpSupport.

Since Web services are often configured and deployed using information from external XML resources, it is often necessary to suppress reduction for some applications. For example, during service deployment the Web services framework parses WSDL documents into Smalltalk objects. Since the resulting Smalltalk WSDL objects are not directly referenced by application code, the classes must always be included in runtime images by preventing reduction. The sample packaging instructions shown below demonstrate how reduction can be prevented.

To prevent reduction of an entire application or subapplication, implement the class method #packagingRulesFor: in the application class as shown below:

packagingRulesFor: aPackagedImage
		aPackagedImage doNotReduceSubApplicationNamed: self symbol

To prevent reduction of individual classes, implement the class method #packagingRulesFor: in the application class as shown below:

packagingRulesFor: aPackagedImage
		aPackagedImage doNotReduceClassNamed: #SstWSContainer

Runtime considerations

Using the command line option '-ws:', it is possible to specify a container deployment descriptor file defining the specifications to deploy a Web services container. It is not necessary to specify start up code if you intend to use the '-ws:' command line option. Alternatively, you can specify startup code to deploy a container or start a container from #runtimeStartup method in one of the application classes included in the leaf IC.

The Web services platform will shut down if no network endpoints are activated in the image. A simple way to start a network endpoint to the Web services runtime is to deploy a hosted service that specifies endpoint information in it's deployed WSDL file.

Application prerequisites for services

Individual services need not include Web services support in their prerequisites. The VisualAge Web services support merely provides a mechanism for invoking behavior defined by services.


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