use of org.apache.cxf.binding.soap.saaj.SAAJInInterceptor in project jbossws-cxf by jbossws.
the class JaspiSeverInInterceptor method handleMessage.
@Override
public void handleMessage(SoapMessage message) throws Fault {
if (message.getContent(SOAPMessage.class) == null) {
SAAJInInterceptor saajIn = new SAAJInInterceptor();
saajIn.handleMessage(message);
}
SOAPMessage soapMessage = message.getContent(SOAPMessage.class);
if (soapMessage == null) {
return;
}
SOAPMessage copyMessage = null;
try {
MessageFactory messageFactory = SAAJPreInInterceptor.INSTANCE.getFactory(message);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
soapMessage.writeTo(bout);
copyMessage = messageFactory.createMessage(soapMessage.getMimeHeaders(), new ByteArrayInputStream(bout.toByteArray()));
} catch (SOAPException e) {
throw new Fault(e);
} catch (IOException e) {
throw new Fault(e);
}
if (copyMessage != null) {
message.put(SOAPMessage.class, copyMessage);
}
try {
authManager.validateRequest(message);
} finally {
message.put(SOAPMessage.class, soapMessage);
}
}
Aggregations