1 16 package test.soap; 17 18 import org.apache.axis.AxisFault; 19 import org.apache.axis.MessageContext; 20 import org.apache.axis.handlers.BasicHandler; 21 import org.apache.axis.message.SOAPEnvelope; 22 import org.apache.axis.message.SOAPHeaderElement; 23 24 35 public class TestFaultHandler extends BasicHandler { 36 public void invoke(MessageContext msgContext) throws AxisFault { 37 } 38 39 public void onFault(MessageContext msgContext) { 40 try { 41 SOAPEnvelope env = msgContext.getResponseMessage().getSOAPEnvelope(); 42 SOAPHeaderElement header = new SOAPHeaderElement( 43 TestOnFaultHeaders.TRIGGER_NS, 44 TestOnFaultHeaders.RESP_NAME, 45 "here's the value" 46 ); 47 env.addHeader(header); 48 } catch (Exception e) { 49 throw new RuntimeException ("Exception during onFault processing"); 50 } 51 } 52 } 53 | Popular Tags |