background image

SAAJ application using XWSS

<< Setting up SecurityEnvironmentHandlers | More Information Security >>
<< Setting up SecurityEnvironmentHandlers | More Information Security >>
250
S
ECURING
W
EB
S
ERVICES
example client in the \
jaxws2.0\simple-doclit\src\simple\client\
directory.
// put the security config info
((BindingProvider)stub).getRequestContext().
put(XWSSecurityConfiguration.MESSAGE_SECURITY_CONFIGURATION,
config);
4. Invoke the method on the stub as you would if you were writing the client
without regard to adding XWS-Security. The example for the application
from the \
jaxws2.0\simple-doclit\src\simple\client\
directory is
as shown below:
Holder<String> hold = new Holder("Hello !");
stub.ping(ticket, hold);
To add message security to an existing JAX-RPC, JAX-WS, or SAAJ application
using XWSS, follow these steps on the server side:
1. Create a server security configuration file and give it the name:
serviceName + "_" + "security_config.xml
An example of a server security configuration file can be found in the
\
jaxws2.0\simple-doclit\etc\server_security_config.xml
direc-
tory.
2. No other changes need to be made to the server-side JAX-WS code.
Information
about
running
the
example
application
is
included
in
<JWSDP_HOME>/xws-security/samples/jaxws2.0/simple-doclit/
README.txt
and in the Java WSDP Tutorial.
For more information on XWSS,
· Read the Java Web Services Developer Pack Tutorial. The tutorial can be
accessed from
http://java.sun.com/webservices/docs.html
.
· Read the XWSS samples documentation, which is located in the
<JWSDP_HOME>/xws-security/samples/
directory of your Java WSDP
installation or at
http://java.sun.com/webservices/docs/2.0/xws-
security/samples.html
online.
· Visit the XWSS home page at
http://java.sun.com/webservices/
xwss/
.