axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Leitner <noz...@sbox.tugraz.at>
Subject Re: Session Lifecycle vs. ServiceLifecycle ?
Date Fri, 16 Aug 2002 10:20:49 GMT
Hi Matthias,

thank you very much for your quick and informative mail.

On Fri, Aug 16, 2002 at 11:22:11AM +0200, Matthias Brunner wrote:
> On Friday 16 August 2002 10:20, Andreas Leitner wrote:
> > Hi,
> >
> > I understand that the interface ServiceLifecycle is to be implemented when
> > I am interested when the service in question gets activated/inactive. (A
> > minor note: init() and destroy() are made available for the service client
> > - by the automatic WSDL generator - which I think they should not, but it's
> > not a big deal - at least for me :)
> 
> This is a known bug in Axis 1.0b3 and AFAIK fixed in CVS (of course, you must 
> not include init and destroy into your "allowedMethods").

I see. Thanks for the info.

> >
> > My real question is, when I use some sort of session management be it
> > header id or cookies, is there something similar to ServiceLifecycle I
> > could use to track sessions? I could imaging the following interface:
> >
> > init ():
> > 	Called whenever a new session is created (this might be redundant with the
> > constructor, since for a new session a new object is to be created anyway,
> > if i am not mistaken)
> >
> > destroy ():
> > 	Called if the session times out or if the client closes the connection
> > (underlying transport, not sure if there is a official SOAP way to
> > terminate a session, prob. not because IIRC soap doesn't know about
> > sessions)
> 
> ServiceLifeCycle is exactly what you want.
> Operate the service in session scope. ServiceLifeCycle.init is called at the 
> beginning of every session and ServiceLifeCycle.destroy at the end.
> Be careful, though, the context object in ServiceLifeCycle.init is set to null 
> in 1.0b3 (fixed in CVS)

Again thanks. I am able to trigger "init"s correctly. No problem here. But I have not every
succeeded triggering "destroy" other than calling it directly. Is there any way to reproduce
a termination of the session?

What I have done so far:

*) Produced a Axis Web Service with cookie session scope
*) Set the timeout of the session (via Session.setTimeout) in "init" to 1 (that function is
called - I can see it in the log)
*) then from a dot net client (which generates his proxy via the autogenerated wsdl file)
I initiate a connection and call some function. on the first call of some dummy SOAP function,
"init" shows up in the log. then i close the app and wait... wait... wait (and "destroy" does
not show up in the log, and thus is not beeing called)
*) status quo: I have no idea how I should go to trigger a call to "destroy"

many thanks in advance,
Andreas


Mime
View raw message