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

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

Introduction

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

Prototype

public boolean handleMessage(C context);

Source Link

Document

The handleMessage method is invoked for normal processing of inbound and outbound messages.

Usage

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

private boolean callHandleMessageWithTracker(Handler handler) throws RuntimeException {
    currentHandler = handler;/*from w  ww  .j av a 2  s  .  c  o  m*/
    currentMethod = "handleMessage";
    // 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.handleMessage(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;
}