I am extending WSS4JInInterceptor for passing in the configuration only. It's
calling super.handleMessage.
 

public class ServerInterceptor extends WSS4JInInterceptor{ 
        public ServerInterceptor() { 
                super(); 
                HashMap hm = new HashMap(); 
                hm.put("action", "UsernameToken"); 
                hm.put("passwordType", "PasswordText"); 
                hm.put("passwordCallbackClass",
"edu.uci.rice.kim.service.wssecurity.ServerPasswordCallback"); 
                this.setProperties(hm); 
        } 
        
        public void handleMessage(SoapMessage msg) { 
                System.out.println("in handleMessage"); 
                super.handleMessage(msg); 
        } 
} 

public class ServerPasswordCallback implements CallbackHandler { 

        @Override 
        public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException { 
                // TODO Auto-generated method stub 
                WSPasswordCallback pc = (WSPasswordCallback) callbacks[0]; 

        if ("joe".equals(pc.getIdentifier())) { 
           pc.setPassword("joespassword"); 
        } 
        } 
} 



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Interceptors-for-WS-security-tp5722285p5724524.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to