Configuring WS-Security for Axis 1.4 client

May 23, 2007 1 minutes read

I was looking how to enable WS-Security features in the Axis client to my web service application. I have tested it with Axis 1.4 client.

The things you need to configure axis client are:

  1. Copy wss4j.jar (rev. 1.5.1), opensaml-1.1.jar and xmlsec-20050514.jar (from the openSAML distribution) to classpath (WEB-INF/lib)

  2. Add handler to client.wsdd:

    <!-- Using the WSDoAllSender security handler in request flow -->
    <deployment xmlns="" java="">
        <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender">
                    <handler type="">
                        <parameter name="action" value="UsernameToken"/>
                        <parameter name="passwordType" value="PasswordDigest"/>
                        <parameter name="mustUnderstand" value="false"/>

You don’t need to hardcode username and password as a handler parameters. Just call setUsername(…) and setPassword(…) methods of your Stub.

logo   Never miss a story, subscribe to our newsletter