You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Daniela CLARO <da...@eseo.fr> on 2005/03/11 16:35:46 UTC

Problem in deploying with wss4j

Hi all, 
 I am using Tomcat 5.0.25 with Java 1.4.2_06-b03, Axis 1.2, and I put wss4j
that I download from http://www.sagagames.com/johan/blog/wss4j.jar and I
download xmlsec.jar at "Found XML Security API
(org.apache.xml.security.Init) at C:\Program Files\Apache Tomcat
5.0\webapps\axis\WEB-INF\lib\xmlsec.jar"

The problem is that when I deploy that

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 <service name="stock-wss-01" provider="java:RPC" style="document"
use="literal">
  <requestFlow>
   <handler type="java:org.apache.ws.axis.security.WSDoAllReceiver">
    <parameter name="passwordCallbackClass" value="PWCallback"/>
    <parameter name="action" value="UsernameToken"/>
   </handler>
  </requestFlow>
  <parameter name="className" value="samples.stock.StockQuoteService"/>
  <parameter name="allowedMethods" value="getQuote"/>
  <parameter name="scope" value="application"/>
 </service>
</deployment> 

And if I did not use the handler, all think works. I create the class
PWCallback 
import java.io.IOException;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import org.apache.ws.security.WSPasswordCallback;

public class PWCallback implements CallbackHandler {
    public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            if (callbacks[i] instanceof WSPasswordCallback) {
                WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
                // set the password given a username
                if ("wss4j".equals(pc.getIdentifer())) {
                    pc.setPassword("security");
                }
            } else {
                throw new UnsupportedCallbackException(callbacks[i],
"Unrecognized Callback");
            }
        }
    }
}

I want to know if isn't it some lib that I am missing...I checked all, I did
not find, please, if you have some idea, mail me!
Thank you
Daniela