axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Walker, Jeff" <Jeff.Wal...@fmr.com>
Subject RE: Injecting Handlers into Axis 1.X at Runtime
Date Wed, 22 Aug 2007 12:39:40 GMT
Hi Sumit,
looks like I am the only respondent!
Yes, it can be done programmatically in Axis1.4.
Something like this is required:
 
private static void registerClientHandlers(PaGWebService_ServiceLocator
locator) {

try {

//======================================

//Register Clientside Handler

//======================================

javax.xml.namespace.QName portName = new
javax.xml.namespace.QName("sessions", "PaGWebService"); 

javax.xml.rpc.handler.HandlerRegistry hr = locator.getHandlerRegistry();

java.util.List handlerChain = hr.getHandlerChain(portName);

javax.xml.rpc.handler.HandlerInfo hInfo = new
javax.xml.rpc.handler.HandlerInfo();

hInfo.setHandlerClass(client.ClientSideHandler.class);

handlerChain.add(hInfo); 

}

catch (Exception e) {

System.out.println("Caught an exception when registering the clientside
handler: " + e.getMessage());

}

}

I pass in the locator reference, but I could have gotten it from:
PaGWebService_ServiceLocator locator = new
PaGWebService_ServiceLocator();

Obviously, you need to get the namespace correct and the location for
the handler class itself must be in the classpath for the project.
Also, I registered a JAX-RPC handler, not the Axis kind. My class
extends javax.xml.rpc.handler.GenericHandler.
The above code works on the client side. There must be a suitable
location to register the handler on the server side as well, just not
sure where.
Regards,
-jeff
  _____  

From: Shah, Sumit [mailto:sumit.shah@cgi.com] 
Sent: Tuesday, August 21, 2007 4:08 PM
To: axis-user@ws.apache.org
Subject: Injecting Handlers into Axis 1.X at Runtime



	Hello,

	 

	I would like to inject a handler into Axis 1.4 at runtime
through java instead of configuring it in *.wsdd. 

	I am trying to find out if it's possible. If yes, how can I do
that?

	 

	I would appreciate any response on this.

	 

	Thanks

	Sumit


Mime
View raw message