SOAPHeaderHandler implements SOAPHandler<SOAPMessageContext> { @Override public boolean handleFault(SOAPMessageContext messageContext) { LOG.warn("SoapHeaderHandler.handleFault"); Boolean isOutboundMessage = (Boolean) messageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); try { SOAPMessage oMessage = messageContext.getMessage(); SOAPHeader oHeader = oMessage.getSOAPHeader(); if (isOutboundMessage) { addMustUnderstandAttribute(oHeader); } } catch (SOAPException ex) { LOG.warn("Exception adding mustunderstand to fault: {}", ex.getLocalizedMessage()); LOG.trace("Exception adding mustunderstand to fault: {}", ex.getLocalizedMessage(), ex); } return true; }  @Override Set<QName> getHeaders(); @Override boolean handleMessage(SOAPMessageContext messageContext); @Override boolean handleFault(SOAPMessageContext messageContext); @Override void close(MessageContext context);  }
@Test public void testHandleFault() { SOAPHeaderHandler headerHandler = new SOAPHeaderHandler(); assertTrue(headerHandler.handleFault(messageContext)); }