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.
The package containing 'Hello World Service' is deployed and undeployed in this demo.
In addition to the files described in Files and Directories, this demo contains:
File or directory | Description |
---|---|
src/demo/management/deploy/client/Deploy.java | Deployment implementation |
src/demo/management/deploy/client/Undeploy.java | Undeployment implementation |
The demo assumes that you have installed following components:
Core-Tools core-tools.jar on the client side
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.
To run using Persistent Deployment:
Be sure that you've started SESJ.
Compile HelloService.
Windows: run.bat make_service Linux: ./run.sh make_service
Make the client classes.
Windows: run.bat make_client Linux: ./run.sh make_client
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.
Undeploy HelloService from the SESJ.
Windows: run.bat undeploy_service Linux: ./run.sh undeploy_service
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