FileDocCategorySizeDatePackage
TestFaultHandler.javaAPI DocApache Axis 1.42097Sat Apr 22 18:57:26 BST 2006test.soap

TestFaultHandler

public class TestFaultHandler extends org.apache.axis.handlers.BasicHandler
This is a test Handler which interacts with the TestService below in order to test header processing. This one runs before the TestHandler, so when the TestHandler throws an Exception (triggered by a particular header being sent from TestOnFaultHeaders), the onFault() method gets called. In there, we get the response message and add a header to it. This header gets picked up by the client, who checks that it looks right and has successfully propagated from here to the top of the call stack.
author
Glen Daniels (gdaniels@apache.org)

Fields Summary
Constructors Summary
Methods Summary
public voidinvoke(org.apache.axis.MessageContext msgContext)

    
public voidonFault(org.apache.axis.MessageContext msgContext)

        try {
            SOAPEnvelope env = msgContext.getResponseMessage().getSOAPEnvelope();
            SOAPHeaderElement header = new SOAPHeaderElement(
                    TestOnFaultHeaders.TRIGGER_NS,
                    TestOnFaultHeaders.RESP_NAME,
                    "here's the value"
            );
            env.addHeader(header);
        } catch (Exception e) {
            throw new RuntimeException("Exception during onFault processing");
        }