package gov.epa.state.sample.client;

import org.apache.axis.*;
import org.apache.axis.handlers.BasicHandler;

public class SOAPMonitor extends BasicHandler
{
	public void invoke(MessageContext msgContext) throws AxisFault
	{
		if (msgContext.getPastPivot())
		{
			Message inMsg = msgContext.getRequestMessage();
			Message outMsg = msgContext.getResponseMessage();

			if (inMsg != null)
			{
				System.out.println();
				System.out.println(":::SOAP Request:::");
				System.out.println();

System.out.println(inMsg.getSOAPPartAsString());
			}

			if (outMsg != null)
			{
				System.out.println();
				System.out.println(":::SOAP Response:::");
				System.out.println();

System.out.println(outMsg.getSOAPPartAsString());
				System.out.println();
			}
		}
	}

	public void undo(MessageContext msgContext)
	{
	}
}
