ArrayList outFaultPhases = new ArrayList();
outFaultPhases.addAll((ArrayList) faultExecutionChain.clone());
msgContext.setExecutionChain((ArrayList) outFaultPhases.clone());
msgContext.setFLOW(MessageContext.OUT_FAULT_FLOW);
try {
InvocationResponse pi = invoke(msgContext, NOT_RESUMING_EXECUTION);
if (pi.equals(InvocationResponse.SUSPEND)) {
log.warn(msgContext.getLogIDString() +
" The resumption of this flow may function incorrectly, as the OutFaultFlow will not be used");
return;
} else if (pi.equals(InvocationResponse.ABORT)) {
flowComplete(msgContext);
return;
} else if (!pi.equals(InvocationResponse.CONTINUE)) {
String errorMsg =
"Unrecognized InvocationResponse encountered in AxisEngine.sendFault()";
log.error(msgContext.getLogIDString() + " " + errorMsg);
throw new AxisFault(errorMsg);
}
}
catch (AxisFault e) {
msgContext.setFailureReason(e);
flowComplete(msgContext);
throw e;
}
}
ArrayList<Handler> executionChain = new ArrayList<Handler>(msgContext.getConfigurationContext()
.getAxisConfiguration().getOutFaultFlowPhases());
msgContext.setExecutionChain(executionChain);
msgContext.setFLOW(MessageContext.OUT_FAULT_FLOW);
InvocationResponse pi = invoke(msgContext, NOT_RESUMING_EXECUTION);
if (pi.equals(InvocationResponse.CONTINUE)) {
// Actually send the SOAP Fault
TransportOutDescription transportOut = msgContext.getTransportOut();
if (transportOut == null) {
throw new AxisFault("Transport out has not been set");
}
TransportSender sender = transportOut.getSender();
sender.invoke(msgContext);
flowComplete(msgContext);
} else if (pi.equals(InvocationResponse.SUSPEND)) {
} else if (pi.equals(InvocationResponse.ABORT)) {
flowComplete(msgContext);
} else {
String errorMsg =
"Unrecognized InvocationResponse encountered in AxisEngine.sendFault()";
log.error(msgContext.getLogIDString() + " " + errorMsg);