You can implement a CallbackHandler:
public class PasswordCallbackHandler implements CallbackHandler {
@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for(Callback callBack:callbacks){
if(callBack instanceof WSPasswordCallback){
((WSPasswordCallback)callBack).setPassword("password");
}
}
}
}
then add the handler to the properties:
outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, PasswordCallbackHandler.class);
you can also use PW_CALLBACK_REF to set a reference of the handler.