1 55 56 package org.jboss.axis.handlers; 57 58 import org.jboss.axis.AxisFault; 59 import org.jboss.axis.Constants; 60 import org.jboss.axis.Message; 61 import org.jboss.axis.MessageContext; 62 import org.jboss.axis.message.SOAPEnvelopeAxisImpl; 63 import org.jboss.axis.message.SOAPHeaderElementAxisImpl; 64 import org.jboss.axis.utils.Messages; 65 import org.jboss.logging.Logger; 66 67 68 71 public class DebugHandler extends BasicHandler 72 { 73 private static Logger log = Logger.getLogger(DebugHandler.class.getName()); 74 75 public static final String NS_URI_DEBUG = "http://xml.apache.org/axis/debug"; 76 77 public void invoke(MessageContext msgContext) throws AxisFault 78 { 79 log.debug("Enter: DebugHandler::invoke"); 80 try 81 { 82 Message msg = msgContext.getRequestMessage(); 83 84 SOAPEnvelopeAxisImpl message = (SOAPEnvelopeAxisImpl)msg.getSOAPEnvelope(); 85 SOAPHeaderElementAxisImpl header = message. 86 getHeaderByName(NS_URI_DEBUG, "Debug"); 87 88 if (header != null) 89 { 90 Integer i = ((Integer )header 91 .getValueAsType(Constants.XSD_INT)); 92 if (i == null) 93 throw new AxisFault(Messages.getMessage("cantConvert03")); 94 95 int debugVal = i.intValue(); 96 log.debug(Messages.getMessage("debugLevel00", "" + debugVal)); 97 header.setProcessed(true); 99 } 100 } 101 catch (Exception e) 102 { 103 log.error(Messages.getMessage("exception00"), e); 104 throw AxisFault.makeFault(e); 105 } 106 log.debug("Exit: DebugHandler::invoke"); 107 } 108 109 public void onFault(MessageContext msgContext) 110 { 111 log.debug("Enter: DebugHandler::onFault"); 112 log.debug("Exit: DebugHandler::onFault"); 113 } 114 115 } 116 117 ; 118 | Popular Tags |