Programmatic Deployment Demo  Locate

Overview  Locate

This demo shows how to deploy and undeploy a service package using API calls. To deploy a service using programmatic deployment you need a JAR package containing the service which can be prepared by the WaspPackager tool.

What You Will Learn  Locate

The package containing 'Hello World Service' is deployed and undeployed in this demo.

Demo Package Description  Locate

In addition to the files described in Files and Directories, this demo contains:

File or directoryDescription
src/demo/management/deploy/client/Deploy.java

Deployment implementation

src/demo/management/deploy/client/Undeploy.java

Undeployment implementation

Prerequisites and Preparatory Steps  Locate

The demo assumes that you have installed following components:

Core-Tools
core-tools.jar          on the client side

Building and Running Demos  Locate

You can run the demo using the "run.sh" (for Unix) or "run.bat" (for Windows) scripts. Running the script without arguments prints out a help message on screen.

Persistent Deployment  Locate

To run using Persistent Deployment:

  1. Be sure that you've started SESJ.

  2. Compile HelloService.

    Windows: run.bat make_service
    Linux:   ./run.sh make_service
    
  3. Make the client classes.

    Windows: run.bat make_client
    Linux:   ./run.sh make_client
    
  4. Deploy HelloService on the SESJ.

    Windows: run.bat deploy_service
    Linux:   ./run.sh deploy_service
    

    You can look at HelloService WSDL on 'http://localhost:6060/demo/basic/HelloService/wsdl' from the browser.

  5. Undeploy HelloService from the SESJ.

    Windows: run.bat undeploy_service
    Linux:   ./run.sh undeploy_service
    

Notes  Locate

If you have installed SESJ with security, modify deploy_service and undeploy_service targets:

Append security_providers_client.jar to classpath:

Windows: %WASP_HOME%\lib\security_providers_client.jar
Linux:   "$WASP_HOME"/lib/security_providers_client.jar

Add following java properties to the java command:

-Dwasp.username=ADMIN_NAME
-Dwasp.password=ADMIN_PASSWORD
-Dwasp.securityMechanism=HttpBasic

ADMIN_NAME is the name of the administrator (you set it when you were installing security. The default name is "admin").

ADMIN_PASSWORD is the administrator's password (default is "changeit"). Security mechanism used by deploy service is HttpBasic by default.

Update java command by specifying location of JAAS configuration file:

Windows: "-Djava.security.auth.login.config=%WASP_HOME%\conf\jaas.config"
Linux:   -Djava.security.auth.login.config="$WASP_HOME"/conf/jaas.config