Upul Godage wrote:
Hi,
String ret = (String) call.invoke( new Object[] { textToSend } );
call.getMessageContext().getMessage().writeTo(System.out); // Writes
to the given OutputStream
Upul
On Tue, Mar 4, 2008 at 3:33 PM, Seetha Rama Krishna
<[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
Hi,
I deployed the sample code which is distributed by axis, I
just wanted to see the SOAP Request message through programming.
I had done this through TCPMON. I need to check it through
programming. How can i do this. I tried to modify the code
Client code for MyService webservice.
MessageContext mc = new MessageContext(null);
System.out.println(mc.getAxisEngine());
String ret = (String) call.invoke( new Object[] { textToSend } );
System.out.println(AxisEngine.getCurrentMessageContext().getRequestMessage());
I am getting nullpointer Exception when i run this code.
By using TCPMonitor, i need to check the SOAP Request
Messages and Response message of Remote webservice.
How can i do this
Thanks & Regards,
Krishna
------------------------------------------------------------------------
Now you can chat without downloading messenger. Click here
<http://in.rd.yahoo.com/tagline_webmessenger_5/*http://in.messenger.yahoo.com/webmessengerpromo.php>
to know how.
I use a simple customer module that I configured through axis2.xml:
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.handlers.AbstractHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Simple handler that logs the contents of SOAPs messages to INFO via
* the jakarta commons logging package.
*
* Handler typically is configured to capture messages passing through
* either the IN or OUT phases of Axis2. To register the handler enter an
* xml element similar to the one below in your axis2.xml:
*
* <phaseOrder type="InFlow">
* ...
* <phase name="userMonitorPhase">
* <handler name="SOAPSniffer"
* class="com.fry.axis2.module.SOAPSnifferHandler">
* <order phase="userMonitorPhase"/>
* </handler>
* </phase>
* ...
* </phaseOrder>
*
* @author foo
*
*/
public class SOAPSnifferHandler extends AbstractHandler {
private Log log = LogFactory.getLog(getClass());
public InvocationResponse invoke(MessageContext context) throws
AxisFault {
SOAPEnvelope envelope = context.getEnvelope();
log.info( envelope.toString() );
return InvocationResponse.CONTINUE;
}
}