* @param fault the fault if one is set
*/
private static String getActionFromServiceModel(Message message,
Exception fault) {
String action = null;
BindingOperationInfo bindingOpInfo =
message.getExchange().get(BindingOperationInfo.class);
if (bindingOpInfo != null) {
if (bindingOpInfo.isUnwrappedCapable()) {
bindingOpInfo = bindingOpInfo.getUnwrappedOperation();
}
if (fault == null) {
action = (String)message.get(ACTION);
if (StringUtils.isEmpty(action)) {
action = (String) message.get(SoapBindingConstants.SOAP_ACTION);
}
if (action == null || "".equals(action)) {
MessageInfo msgInfo =
ContextUtils.isRequestor(message)
? bindingOpInfo.getOperationInfo().getInput()
: bindingOpInfo.getOperationInfo().getOutput();
String cachedAction = (String)msgInfo.getProperty(ACTION);
if (cachedAction == null) {
action = getActionFromMessageAttributes(msgInfo);
} else {
action = cachedAction;
}
if (action == null && ContextUtils.isRequestor(message)) {
SoapOperationInfo soi = getSoapOperationInfo(bindingOpInfo);
action = soi == null ? null : soi.getAction();
action = StringUtils.isEmpty(action) ? null : action;
}
}
} else {
Throwable t = fault.getCause();
// FaultAction attribute is not defined in
// http://www.w3.org/2005/02/addressing/wsdl schema
for (BindingFaultInfo bfi : bindingOpInfo.getFaults()) {
FaultInfo fi = bfi.getFaultInfo();
Class<?> fiTypeClass = fi.getMessagePart(0).getTypeClass();
if (t != null
&& fiTypeClass != null
&& t.getClass().isAssignableFrom(fiTypeClass)) {