Web services Guide


Deploying a Web service in VisualAge Smalltalk

Below are the steps required to create and deploy a Web service created in VisualAge Smalltalk. In this example you will:

VisualAge manages Web services through the use of a Web services container. The purpose of the container is to facilitate the lifecycle management of a Web service. In addition, the container acts as a 'home' for the different services. Therefore, once a service is deployed, it can be located in the container by utilizing the SstWSContainer API, serviceNamed:inNamespace:.

Another important aspect of the container is the ability to establish and manage a collection of endpoints whose sole responsibility is to facilitate service requests. That is, there is a distinct architectural difference between the endpoint of a SOAP node and an Application server's endpoint. Therefore, a separation has been introduced between the HTTP server and the network endpoints managed by the container. Specifically, it is recommended that a separate HTTP server be started (e.g. SST HTTP Server, IBM HTTP Server, or Apache Tomcat) that will serve up the WSDL documents.

The examples in this guide specify URL resources using a host name of 'vasthost'. You must add a line to your 'hosts' file, or use any hostname valid for your environment in place of 'vasthost', in order to successfully execute the described examples.

ie)

 127.0.0.1      vasthost
  1. Start an SST HTTP server or equivalent on port 9999 on VASTHOST. If you use SST, it is recommended that you inspect the results to ensure you can properly shut down the server at the end of the examples.
    	|server|
    	server := SstHttpServerExample runAt: 'http://:9999' 
                  in: (AbtXmlConfiguration current defaultResourceQualifier).
     
    
  2. Start a container to host all deployed services. Note: This will clear all existing containers to ensure that you are starting clean.
      [ | aContainer |
      SstWSContainer clearAll.
      aContainer := SstWSContainer createContainerNamed:  SciSocketManager default getHostName
          using: (SstWSContainerConfiguration defaultConfiguration).
          aContainer startUp.
      aContainer inspect ] fork
    
  3. Once the container has been started, services defined inside of a WSDL document or described in a deployment descriptor may be deployed. The deployment descriptor is a file that provides meta information about the service, such as the implementation class and the location of the service WSDL. The XML document (and the documents that are imported) is fetched from the external server running on vasthost:9999. This can be any valid HTTP URL. During deployment, VisualAge Smalltalk attempts to start the network endpoints required in order to host the described services. This is accomplished using information derived from the WSDL port entries from the WSDL document. Below is the code example for step #3:
      [ | aContainer aServiceCollection|
      aContainer := SstWSContainer containerNamed: SciSocketManager default getHostName.
      aServiceCollection := aContainer deploy: 'http://vasthost:9999/SstWSInsurancePolicyInterface.xml'.
        aServiceCollection inspect ] fork
    

That's it! After completing the steps above, it is possible to invoke the deployed service via SOAP messages over HTTP. The next section describes how this is done with VisualAge Smalltalk.


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