You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Guillaume Sauthier <Gu...@objectweb.org> on 2004/12/01 13:37:04 UTC

Different behavior when invoking ClientSide JAXRPC Handlers and ServerSide JAXRPC Handlers

Hi team,

I have noticed that the behavior of JAXRPC handlers is different when 
invoking from client-side compared to behavior when invoking from 
server-side.

1. handler flow is managed in a different way :
a) server : init(), request(), provider.invoke(), response(), destroy()
b) client : init(), request(), destroy(), service.invoke(), init(), 
response(), destroy()
-> Instanciation of the handlers (in a HandlerChain) is made twice in 
client model

2. the code is completely different on both sides :
see SOAPService.invoke(MessageContext) (around line 430) for server side
http://cvs.apache.org/viewcvs.cgi/ws-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java?rev=1.122&view=auto
see AxisClient.invoke() and AxisClient.invokeJAXRPCHandlers()

in server case, we take care of the return value of the HandlerChain, 
use the same handlerChain instance, manage eventual thrown Exceptions, ...
All sort of things that we don't do in client side.
IMO client side JAXRPCHandler usage is too simple :
invoke() calls invokeJAXRPCHandlers() in request flow AND response flow
invokeJAXRPCHandlers() instanciate a new handlerChain at each call, and 
never read return values of handle* (BTW, notice that handlerFault is 
not called in client side !).

Can we refactor axis Client code to looks like more as SOAPService ?

regards
Guillaume

Re: Different behavior when invoking ClientSide JAXRPC Handlers and ServerSide JAXRPC Handlers

Posted by Davanum Srinivas <da...@gmail.com>.
Yes, please.

thanks,
dims


On Wed, 01 Dec 2004 13:37:04 +0100, Guillaume Sauthier
<gu...@objectweb.org> wrote:
> Hi team,
> 
> I have noticed that the behavior of JAXRPC handlers is different when
> invoking from client-side compared to behavior when invoking from
> server-side.
> 
> 1. handler flow is managed in a different way :
> a) server : init(), request(), provider.invoke(), response(), destroy()
> b) client : init(), request(), destroy(), service.invoke(), init(),
> response(), destroy()
> -> Instanciation of the handlers (in a HandlerChain) is made twice in
> client model
> 
> 2. the code is completely different on both sides :
> see SOAPService.invoke(MessageContext) (around line 430) for server side
> http://cvs.apache.org/viewcvs.cgi/ws-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java?rev=1.122&view=auto
> see AxisClient.invoke() and AxisClient.invokeJAXRPCHandlers()
> 
> in server case, we take care of the return value of the HandlerChain,
> use the same handlerChain instance, manage eventual thrown Exceptions, ...
> All sort of things that we don't do in client side.
> IMO client side JAXRPCHandler usage is too simple :
> invoke() calls invokeJAXRPCHandlers() in request flow AND response flow
> invokeJAXRPCHandlers() instanciate a new handlerChain at each call, and
> never read return values of handle* (BTW, notice that handlerFault is
> not called in client side !).
> 
> Can we refactor axis Client code to looks like more as SOAPService ?
> 
> regards
> Guillaume
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/