You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Li, Peng" <pe...@eds.com> on 2002/08/13 11:58:31 UTC

Problem with SimpleSessionHandler

Hello,

I am trying to use SimpleSessionHandler in my project. And it does not work
on the client side, because : every time I call a function in this service,
the response soap message header has an incresed sessionId. And the next
request soap message from the same call contains no header with the
sessionID, what the SimpleSessionHandler-implementation should do (see the
src).  By debug, is obvious, that the context.isClient() returns always
false in the method SimpleSessionHandler.invoke(MessageContext context).

I read all the discussion on session and the simplesession test.java, but
still could not figure it out. I don't know what is wrong. Please help me. 

I did the following: 

1. deploy the service as scope = session 
2. add simplesession handler in requestFlow and responseFlow for this
service on both server- and clientside. 
3. deploy it by using java org.apache.axis.utils.Admin server deploy.wsdd
and  java org.apache.axis.utils.Admin client client_deploy.wsdd 
4. set session to true in client side: call.setMaintainSession(true) 
5. put the server-config.wsdd  in the directory WEB-INF/ and
client-config.wsdd in the directory WEB-INF/classes/test/

my deploy.wsdd for the service on the server side is:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
            
 <handler name="SessionHandler"
type="java:java:org.apache.axis.handlers.SimpleSessionHandler"/>
 
 <service name="MyService" provider="java:RPC">
  
  <requestFlow>   
  	<handler type="SessionHandler"/>
  </requestFlow>
  
  <responseFlow>
    <handler type="SessionHandler"/>
  </responseFlow>
     
  <parameter name="className" value="test.MyService"/>
  <parameter name="allowedMethods" value="*"/>
  <parameter name="scope" value="session"/>
  
 </service>
 
</deployment>

and client_deploy.wsdd is:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
  
  <handler name="SessionHandler"
type="java:org.apache.axis.handlers.SimpleSessionHandler"/>
  
  <service name="MyService">
    <requestFlow>
       <handler type="SessionHandler"/>
    </requestFlow>

    <responseFlow>
       <handler type="SessionHandler"/>
     </responseFlow>
  </service>
</deployment>


Please help! 

Lots of thanks! 

Peng


Re: Problem with SimpleSessionHandler

Posted by yx...@wm.edu.
hello,

I had the same problem before.

Try to change your handler in client side. Put the
simpleSessionHandler in transport 

 <transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender">
	<requestFlow>
   	<handler name="sessionHandler"
type="java:org.apache.axis.handlers.SimpleSessionHandler"/>
  	</requestFlow>
  	<responseFlow>
   	<handler name="sessionHandler"
type="java:org.apache.axis.handlers.SimpleSessionHandler"/>
  	</responseFlow>
</transport>

It works for me!

Good luck!

Quoting "Li, Peng" <pe...@eds.com>:

> Hello,
> 
> I am trying to use SimpleSessionHandler in my
> project. And it does not work
> on the client side, because : every time I call
> a function in this service,
> the response soap message header has an incresed
> sessionId. And the next
> request soap message from the same call contains
> no header with the
> sessionID, what the
> SimpleSessionHandler-implementation should do
> (see the
> src).  By debug, is obvious, that the
> context.isClient() returns always
> false in the method
> SimpleSessionHandler.invoke(MessageContext
> context).
> 
> I read all the discussion on session and the
> simplesession test.java, but
> still could not figure it out. I don't know what
> is wrong. Please help me. 
> 
> I did the following: 
> 
> 1. deploy the service as scope = session 
> 2. add simplesession handler in requestFlow and
> responseFlow for this
> service on both server- and clientside. 
> 3. deploy it by using java
> org.apache.axis.utils.Admin server deploy.wsdd
> and  java org.apache.axis.utils.Admin client
> client_deploy.wsdd 
> 4. set session to true in client side:
> call.setMaintainSession(true) 
> 5. put the server-config.wsdd  in the directory
> WEB-INF/ and
> client-config.wsdd in the directory
> WEB-INF/classes/test/
> 
> my deploy.wsdd for the service on the server
> side is:
> <deployment
> xmlns="http://xml.apache.org/axis/wsdd/"
>            
>
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>             
>  <handler name="SessionHandler"
>
type="java:java:org.apache.axis.handlers.SimpleSessionHandler"/>
>  
>  <service name="MyService"
> provider="java:RPC">
>   
>   <requestFlow>   
>   	<handler type="SessionHandler"/>
>   </requestFlow>
>   
>   <responseFlow>
>     <handler type="SessionHandler"/>
>   </responseFlow>
>      
>   <parameter name="className"
> value="test.MyService"/>
>   <parameter name="allowedMethods" value="*"/>
>   <parameter name="scope" value="session"/>
>   
>  </service>
>  
> </deployment>
> 
> and client_deploy.wsdd is:
> <deployment
> xmlns="http://xml.apache.org/axis/wsdd/"
>            
>
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>   
>   <handler name="SessionHandler"
>
type="java:org.apache.axis.handlers.SimpleSessionHandler"/>
>   
>   <service name="MyService">
>     <requestFlow>
>        <handler type="SessionHandler"/>
>     </requestFlow>
> 
>     <responseFlow>
>        <handler type="SessionHandler"/>
>      </responseFlow>
>   </service>
> </deployment>
> 
> 
> Please help! 
> 
> Lots of thanks! 
> 
> Peng
> 
>