Search in sources :

Example 1 with FaultAction

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;
}
Also used : FaultAction(org.apache.cxf.ws.addressing.FaultAction) Fault(org.apache.cxf.interceptor.Fault) WebFault(javax.xml.ws.WebFault) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1 WebFault (javax.xml.ws.WebFault)1 Fault (org.apache.cxf.interceptor.Fault)1 FaultAction (org.apache.cxf.ws.addressing.FaultAction)1