/**
* Creates the CXF message processor that will be used to create the SOAP envelope.
*/
private CxfOutboundMessageProcessor createCxfOutboundMessageProcessor(WSSecurity security) throws MuleException
{
ProxyClientMessageProcessorBuilder cxfBuilder = new ProxyClientMessageProcessorBuilder();
Map<String, Object> configProperties = new HashMap<String, Object>();
cxfBuilder.setMtomEnabled(mtomEnabled);
cxfBuilder.setMuleContext(muleContext);
cxfBuilder.setSoapVersion(soapVersion.getVersion());
if (security != null && security.hasStrategies())
{
for (SecurityStrategy strategy : security.getStrategies())
{
strategy.apply(configProperties);
}
if (cxfBuilder.getOutInterceptors() == null)
{
cxfBuilder.setOutInterceptors(new ArrayList<Interceptor<? extends Message>>());
}
cxfBuilder.getOutInterceptors().add(new WSS4JOutInterceptor(configProperties));
}
CxfOutboundMessageProcessor cxfOutboundMessageProcessor = cxfBuilder.build();
// We need this interceptor so that an exception is thrown when the response contains a SOAPFault.
cxfOutboundMessageProcessor.getClient().getInInterceptors().add(new CheckFaultInterceptor());
// CXF Interceptors that will ensure the SOAP body payload carries every namespace declaration from the