Debug.Print( 1, "Enter: DebugHandler::invoke" );
try {
Message msg = msgContext.getRequestMessage();
SOAPEnvelope message = (SOAPEnvelope)msg.getAsSOAPEnvelope();
SOAPHeader header = message.getHeaderByName(Constants.URI_DEBUG,
"Debug");
if (header != null) {
Integer i = ((Integer)header
.getValueAsType(SOAPTypeMappingRegistry.XSD_INT));
if (i == null)
throw new AxisFault("Couldn't convert value to int");
int debugVal = i.intValue();
Debug.Print( 1, "Setting debug level to: " + debugVal );
Debug.setDebugLevel(debugVal);
header.setProcessed(true);
}
}
catch( Exception e ) {
Debug.Print( 1, e );
throw new AxisFault( e );