Hi G�nter,

do it on the Server, for example in your Impl

//Es wird die Session geholt und der SessionTimeout auf 10 minuten gesetzt.
MessageContext mctx = MessageContext.getCurrentContext();

Session ses =  mctx.getSession();
ses.setTimeout(600);


Tomi



-----Urspr�ngliche Nachricht-----
Von: G�nter Ladwig [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 30. Juni 2004 14:28
An: [EMAIL PROTECTED]
Betreff: Re: Session timeout? (SimpleSessionHandler)


Hi!

I didn't get any response to the message below. Is there really no one 
who knows how to set the timeout? Or is there some other workaround?

Thanks in advance.

G�nter

G�nter Ladwig wrote:
> Hi,
> 
> I'm having some problems with SOAP sessions (SimpleSessionHandler). The 
> web service I'm trying to develop has an initialize() method which needs 
> to be called once before subsequent calls to learnFromURL(). Because of 
> this the object needs to be persistent, which is why I decided to use 
> sessions. As the client is an Axis client I used SimpleSessionHandler. 
> My server-config.wsdd contains this:
> 
>  <handler name="session" 
> type="java:org.apache.axis.handlers.SimpleSessionHandler" />
>  <service name="TextToOntoServer" provider="java:RPC">
>   <requestFlow>
>    <handler type="session" />
>   </requestFlow>
>   <responseFlow>
>    <handler type="session"/>
>   </responseFlow>
>   <parameter name="allowedMethods" value="learn,learnFromURL,initialize"/>
>   <parameter name="scope" value="session" />
>   <parameter name="className" 
> value="edu.unika.aifb.ttoServer.TextToOntoServer"/>
>  </service>
> 
> The client-config.wsdd contains basically the same and in principal the 
> session work, but I think the timeout is too short. The first call to 
> initialize() takes up to 20 seconds to complete, which doesn't seem to 
> be a problem. But learnFromURL() may take up to two minutes or more to 
> complete. Here are excerpts from the client-server conversation:
> 
> Client calls initialize():
> <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>  <soapenv:Body>
>   <initialize 
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>  </soapenv:Body>
> 
> Server response (Session ID included):
> [...]
>  <soapenv:Header>
>   <ns1:sessionID soapenv:mustUnderstand="0" xsi:type="xsd:long" 
>
xmlns:ns1="http://xml.apache.org/axis/session";>5539813838419223788</ns1:sess
ionID> 
> 
>  </soapenv:Header>
> [...]
> 
> Now the client calls learnFromURL() and passes the correct Session ID 
> and the server response (about 2 minutes later) still contains the 
> correct session ID. But the response to the next call contains a 
> different session ID (the client still passed the correct session ID to 
> the server):
> 
> [...]
>  <soapenv:Header>
>   <ns1:sessionID soapenv:mustUnderstand="0" xsi:type="xsd:long" 
>
xmlns:ns1="http://xml.apache.org/axis/session";>-7502308238410131107</ns1:ses
sionID> 
> 
>  </soapenv:Header>
> [...]
> 
> It seems to be that during the first call to learnFromURL() Axis loses 
> the session, perhaps thinking it is inactive as there has been no 
> activity for some time. Therefore it replys with another session ID to 
> the second call to learnFromURL().
> 
> So, is there a way to avoid this? There are two methods in 
> SimpleSessionHandler, which may be useful here: setReapPeriodicity and 
> setDefaultSessionTimeout. But how and where do I call these methods? 
> Neither the web service nor my client have any session code, I only made 
> changes to server-config.wsdd and added a client-config.wsdd.
> 
> Thanks in advance.
> 
> G�nter
> 
> 
> 

Reply via email to