SecurityEventListener securityEventListener =
configureSecurityEventListener(mc, secProps);
outboundWSSec = WSSec.getOutboundWSSec(secProps);
final OutboundSecurityContextImpl outboundSecurityContext = new OutboundSecurityContextImpl();
outboundSecurityContext.putList(SecurityEvent.class, requestSecurityEvents);
outboundSecurityContext.addSecurityEventListener(securityEventListener);
// Save Tokens on the security context
for (String key : outboundTokens.keySet()) {
SecurityTokenProvider<OutboundSecurityToken> provider = outboundTokens.get(key);
outboundSecurityContext.registerSecurityTokenProvider(provider.getId(), provider);
outboundSecurityContext.put(key, provider.getId());
}
newXMLStreamWriter = outboundWSSec.processOutMessage(os, encoding, outboundSecurityContext);
mc.setContent(XMLStreamWriter.class, newXMLStreamWriter);
} catch (WSSecurityException e) {