Hi 
You can use a simple client side handler either by placing the client-confif.wsdd in 
the classpath or you can modify the client config.wsdd in the axis.jar

Your client handler class should extend the BasicHandler class, here is a sample code 
and client-confif.wsdd
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
package clienthandler;

import org.apache.axis.Handler;
import org.apache.axis.MessageContext;
import org.apache.axis.AxisFault;
import org.apache.axis.Message;
import org.apache.axis.handlers.BasicHandler;
import org.apache.axis.SOAPPart;
import org.apache.axis.message.SOAPEnvelope;

import org.w3c.dom.Element;
import org.apache.axis.utils.XMLUtils;

import java.io.*;
import java.util.Date;





public class Hello extends BasicHandler{

public Hello(){}

public void invoke(MessageContext messagecontext){


try{

Message requestMessage= messagecontext.getRequestMessage();
SOAPEnvelope env= requestMessage.getSOAPEnvelope();
Element envElement= env.getAsDOM();
String strSOAPBody= XMLUtils.ElementToString(envElement);



System.out.println("Printed by the clientHandler");
System.out.println("Target service name" + messagecontext.getUsername());

System.out.println(messagecontext.getSOAPActionURI());







}catch(Exception ex){ex.printStackTrace();}





        }

}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"; 
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
 <handler name="sayHello" type="java:clienthandler.Hello"/>
 <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
 <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
 <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
</deployment>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Regds
Krish

-----Original Message-----
From: Herman G�bor [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 07, 2004 1:45 AM
To: [EMAIL PROTECTED]
Subject: Logging soap messages on the client side

Hi all,

My application is a web service client and I would like to log the SOAP 
traffic. According to the JAX-RPC I could implement a handler 
(javax.xml.rpc.handler.Handler) and register it in the service registry 
of my Service. The description of the getServiceRegistry method in the 
Axix API documentation says that it is unimplemented and throws an 
UnsupportedOperationException. Are there other ways to implement client 
side logging?

Regards,
G�bor Herman
Software Developer
FlexiTon Kft.


Reply via email to