Example usage for javax.xml.ws.handler Handler handleFault

List of usage examples for javax.xml.ws.handler Handler handleFault

Introduction

In this page you can find the example usage for javax.xml.ws.handler Handler handleFault.

Prototype

public boolean handleFault(C context);

Source Link

Document

The handleFault method is invoked for fault message processing.

Usage

From source file:org.apache.axis2.jaxws.handler.HandlerChainProcessor.java

private boolean callHandleFaultWithTracker(Handler handler) {
    currentHandler = handler;/*from   w  w  w. j av a  2 s  . c om*/
    currentMethod = "handleFault";
    // turn on the tracker property
    currentMC.put(org.apache.axis2.jaxws.handler.Constants.JAXWS_HANDLER_TRACKER, true);
    boolean success = false;
    RuntimeException savedEx = null;
    try {
        success = handler.handleFault(currentMC);
    } catch (RuntimeException t) {
        savedEx = t;
    }
    // turn off the tracker property and reset the static tracker booleans
    currentMC.put(org.apache.axis2.jaxws.handler.Constants.JAXWS_HANDLER_TRACKER, false);
    saaj_called = false;
    soap_headers_adapter_called = false;

    // If the handler changed the SOAPPart or Attachments, then we need
    // that the Message gets updated
    if (currentMC instanceof SoapMessageContext) {
        ((SoapMessageContext) currentMC).checkAndUpdate();
    }

    if (savedEx != null) {
        throw savedEx;
    }
    return success;
}