use of org.apache.cxf.ws.addressing.FaultAction in project cxf by apache.
the class InternalContextUtils method getAction.
/**
* Construct the Action URI.
*
* @param message the current message
* @return the Action URI
*/
public static AttributedURIType getAction(Message message) {
final String action;
LOG.fine("Determining action");
Exception fault = message.getContent(Exception.class);
if (fault instanceof Fault && Names.WSA_NAMESPACE_NAME.equals(((Fault) fault).getFaultCode().getNamespaceURI())) {
// wsa relevant faults should use the wsa-fault action value
action = Names.WSA_DEFAULT_FAULT_ACTION;
} else {
FaultAction annotation = null;
if (fault != null) {
annotation = fault.getClass().getAnnotation(FaultAction.class);
}
if ((annotation != null) && (annotation.value() != null)) {
action = annotation.value();
} else {
action = getActionFromServiceModel(message, fault);
}
}
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("action: " + action);
}
return action != null ? ContextUtils.getAttributedURI(action) : null;
}
Aggregations