} catch (WSSecurityException wssEx) {
throw new AxisFault("WSDoAllReceiver: Error in converting to Document", wssEx);
}
//Do not process faults
SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
if (WSSecurityUtil.findElement(doc.getDocumentElement(), "Fault",
soapConstants.getEnvelopeURI()) != null) {
return;
}
/*
* To check a UsernameToken or to decrypt an encrypted message we
* need a password.
*/
CallbackHandler cbHandler = null;
if ((doAction & (WSConstants.ENCR | WSConstants.UT)) != 0) {
cbHandler = getPasswordCB(reqData);
}
/*
* Get and check the Signature specific parameters first because
* they may be used for encryption too.
*/
doReceiverAction(doAction, reqData);
Vector wsResult = null;
try {
wsResult = secEngine.processSecurityHeader(doc, actor,
cbHandler, reqData.getSigCrypto(), reqData.getDecCrypto());
} catch (WSSecurityException ex) {
ex.printStackTrace();
throw new AxisFault(
"WSDoAllReceiver: security processing failed", ex);
}
if (wsResult == null) { // no security header found
if (doAction == WSConstants.NO_SECURITY) {
return;
} else {
throw new AxisFault(
"WSDoAllReceiver: Request does not contain required Security header");
}
}
if (reqData.getWssConfig().isEnableSignatureConfirmation() && !msgContext.isServerSide()) {
checkSignatureConfirmation(reqData, wsResult);
}
//Setting the original class loader
Thread.currentThread().setContextClassLoader(originalClassLoader);
//TODO: Copy the processed headers
/**
* Set the new SOAPEnvelope
*/
try {
SOAPEnvelope envelope = Axis2Util.getSOAPEnvelopeFromDocument(doc,soapConstants.getEnvelopeURI());
msgContext.setEnvelope(envelope);
} catch (WSSecurityException e) {
throw new AxisFault(
"WSDoAllReceiver: Error in converting into a SOAPEnvelope",e);
}