final RequestData reqData = new RequestData();
reqData.setWssConfig(cfg);
reqData.setUsername("wss40");
// Generate a Key
SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
KeyGenerator keyGen = KeyGenerator.getInstance("AES");
keyGen.init(128);
SecretKey key = keyGen.generateKey();
byte[] keyData = key.getEncoded();
secretKeyCallbackHandler.setOutboundSecret(keyData);
java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
config.put(WSHandlerConstants.PW_CALLBACK_REF, secretKeyCallbackHandler);
config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "SecurityContextToken");
config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");