asant
and/or ant
build files. This document assumes the user is deploying
the sample applications to the Sun Java Systems Application Server, and thus
asant
is used for demonstration purposes. If you are deploying
to a different application server, use the ant
tool instead.
To build, package, deploy, and run the sample applications, follow the correct
steps for your platform:
For Solaris/Linux, follow these steps. On some shells, you would use
setenv
in place ofexport
. When usingsetenv
, replace the=
with a space.
% export JAVA_HOME=<your J2SE installation directory>
% export JWSDP_HOME=<your JWSDP 1.5 installation directory>
% export SJSAS_HOME=<your Application Server installation directory>
(or useSJSWS_HOME
orTOMCAT_HOME
) as applicable)% export ANT_HOME=$SJSAS_HOME
(or the location of your Ant installation)% export PATH=$JWSDP_HOME/jwsdp-shared/bin;$SJSAS_HOME/bin:$PATH
% cd $JWSDP_HOME/xws-security/samples/<sample-name>
% cp build.properties.sample build.properties
- Edit
build.properties
as shown in Editing the build.properties file.- To display usage information for the sample,
% $ANT_HOME/bin/asant
- Follow the instructions provided in
%JWSDP_HOME%/xws-security/samples/<sample-name>/README.txt
for setting up and running the example on each of the three possible containers.For Windows NT/2000/XP:
> set JAVA_HOME=<your J2SE installation directory>
> set JWSDP_HOME=<your JWSDP 1.5 installation directory>
> set SJSAS_HOME=<your Application Server installation directory>
(or useSJSWS_HOME
orTOMCAT_HOME
) as applicable)> set ANT_HOME=%SJSAS_HOME%
(or the location of your Ant installation)> set PATH=%JWSDP_HOME%\jwsdp-shared\bin;%SJSAS_HOME%\bin;%PATH%
> cd %JWSDP_HOME%\xws-security\samples\<sample-name>
> copy build.properties.sample build.properties
- Edit
build.properties
as shown in Editing the build.properties file.- To display usage information for the sample,
> %ANT_HOME%\bin\asant
- Follow the instructions provided in
%JWSDP_HOME%\xws-security\samples\<sample-name>\README.txt
for setting up and running the example on each of the three possible containers.
Copy the file%JWSDP_HOME%\xws-security\samples\<sample-name>\build.properties.sample
tobuild.properties
. The following is a list of the configurable properties with a description of what needs to be modified in thebuild.properties
file:
- javahome: Set this to the location of your Java 2 SDK installation directory
- Uncomment one of the container homes by removing the
#
sign beside the container. Only one container home should be uncommented at a time. Uncomment the container upon which you want to test the sample application, either the Sun Java System Application Server (SJSAS), or Sun Java System Web Server (SJSWS), or Tomcat containers.- username: Replace this with the user name a person assigned to the role of
admin
for your Application Server or other container installation.- password: Replace this with the password for the above user.
- endpoint.host, endpoint.port: Verify the host and port information, as appropriate for your Application Server or other container installation.
- VS.DIR: Enter the name of the virtual server. Applicable only if you are deploying to Web Server (SJSWS).
- jwsdp.home: Set this to the location of your JWSDP 1.5 installation directory.
- jaxrpc.tool.verbose: Set this to true to produce verbose output from the JAX-RPC tools (such as
wscompile
).- http.proxyhost, http.proxyport: Set these to the correct values for your proxy host and proxy port if you are using an example with remote endpoints.
- example: The name of the sample (leave this as is)
- samples/simple
- This sample application lets you plug in different client and server-side configurations describing security settings. This example has support for digital signatures, XML encryption/decryption, and username token verification. This example allows and demonstrates combinations of these basic security mechanisms through configuration files. See the application's README.txt file for more information on running this example.
- samples/jaas-sample
- This sample demonstrates how to plugin a JAAS LoginModule for authentication. This example allows and demonstrates the following functionality:
- Obtaining a username and password from the user at runtime. Sending the username and password in a WSS
UsernameToken
to the server.- Configuring the server application to use JAAS authentication to authenticate the username-password it received.
- Using the SubjectAccessor API from within the endpoint implementation methods to access the sender's subject after authentication.