|
Webservices Security Sample Application |
This document described how to use the Webservices Security sample code to develop a simple Webservice sample which uses message security features of Sun Java System Web Server.
This sample application document contains the following sections:
The Webservices
Security sample application demonstrates how to build, deploy, and
invoke a simple Webservice sample which uses message security (JSR-196).
Complete these prerequisites before you begin to compile and deploy the code.
The
common.properties
file under the install_root/samples/java/webapps
directory defines some of the common properties used by all the samples.
Set the common properties as well as the following properties for this file:
#Server
instance host name
instance.host.name=<Sample's
client will interact with the webservice deployed to the instance on this
host>
#Server instance port number
instance.port.number=<port
number of the instance>
The build.properties file under this sample's src directory contains the sample's build-related properties with default values. The user can modify these properties as needed.
The
password
file used by the CLI contains the passwords required by different commands.
For the request-policy with auth-source
as sender, set the following password properties (besides wadm_password)
in this password file:
wadm_user_password=ymmud
wadm_key_password=changeit
wadm_keystore_password=changeit
wadm_certdb_password=changeit
This section contains instructions for compiling and assembling the sample application. This sample application consists of a server and a client.
Change
to the install_root/samples/java/webapps/webservices/security/fromwsdl-soap12/src
directory and execut the ant
all command.
This
creates jaxws-fromwsdl-soap12.jar
under the install_root/samples/java/webapps/webservices/security/fromwsdl-soap12
directory, deploys this jar
to the specified server instance (instance information is specified in common.properties),
configures the server to enable message security, and compiles and runs
the client.
This can be done in steps. For specific targets, look at build.xml
under install_root/samples/java/webapps/webservices/security/fromwsdl-soap12/src.
(Optional.) Clean the web application project area.
Note - Security configuration for the client is specified in client_security_config.xml under install_root/samples/java/webapps/webservices/security/fromwsdl-soap12/src.
This directory contains
the files for all the supported client security configurations. Depending on
the user-specified configuration for request-policy.*
and response-poly.* in build.properties,
the build environment picks up the appropriate client security configuration
file.
If you encounter problems when running the application, review the log files at instance_root/logs/errors to determine what went wrong.
Copyright © 2007 Sun Microsystems, Inc. All rights reserved.