axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Deploying the client for session handling using SimpleSessionHand ler
Date Tue, 17 Dec 2002 15:21:05 GMT
Hi there,

I got it!!! Its unbelievable, but I really got my Sessions working! I also
deploy my client now. Its rather easy, if you just know exactly how to.
I'm writing now a small HOWTO, because I got nearly crazy with the existing

So now for everybody who probably like to try, here comes a small
Note: The wsdd-files are not complete, the shown data is just an abridgement
of my wsdd-files.
- I do not use generated classes, like the ones from wsdl2java, but it
"should" work the same.

- Write a small service that accesses the session and sets some variable
inside this session. I took a String that was extended each time it is
called by an "a" and then returns this String
- In your server-config file add the SimpleSessionHandler to request AND
response-flow of the service you want to use with sessions. That could look

 <handler name="session"
 <service name="MyService" provider="java:RPC">
   <handler type="session"/>
   <handler type="session"/>
  <parameter name="allowedMethods" value="*"/>
  <parameter name="scope" value="session"/>
  <parameter name="className" value="MyService"/>

- Write a file named client-config.wsdd and put in a directory in your
classpath of the client. That could be the root of your client-application.
Also put in here SimpleSessionHandler in request an response-flow; the file
could look like:

   <handler type="session"/>
   <handler type="session"/>
 <parameter name="scope" value="session"/>
 <handler name="session"

- Ensure that on the client you use the same (just once instantiated)
service-object to create all your calls. That was a big mistake for me. I
did not take care about this
- After instantiating your service, set the MaintainSession to true before
your instantiate your calls from this service.

I think if you follow this, you should see in the SOAP-message (e.g. with
tcpmon) that the session ID is transferred in the sopaenv-header in the
response and request-message.
At least that works for me.

hope somebody can use it and wont get grey hair like me :-))

Greetings from Hamburg/Germany

-----Urspr√ľngliche Nachricht-----
Von: Klaus Thiele [] 
Gesendet: Freitag, 13. Dezember 2002 17:09
Betreff: Re: AW: Deploying the client

Hi Sebastian,

i'm new to axis an i'm currently working at this problem too.

    java org.apache.axis.wsdl.WSDL2Java --deployScope Session writes
      <parameter name="scope" value="Session"/>
to deploy.wsdd - but it seems that it hasn't any effect.

in my client i do 
        MyServiceLocator sl = new MyServiceLocator();
and then it works with session.

but how to enable this at server-side? it's not nice to set this at 
client-side, i'm also testing with .NET and don't know how to enable this 


Am Freitag, 13. Dezember 2002 16:26 schrieb
> Hi Pascal,
> But I have another question. I need to work with session. What I know 
> is (or what I think I know): I need to define the scope of the service 
> to session, and I have to invoke the SessionHandler during request and 
> response flow. But: I think I have to define request and response-flow 
> on both sides; the client and the server. But in the wsdl-file there 
> is no entry for that flow-definitions I defined for the service on 
> server-side. If I really have to tell the client-side axis to invoke 
> my Handler (i.e. the SimpleSessionHandler) in request and response: 
> How do I tell him without including a wsdd-file? Or do I have to 
> define other stuff to get this working?

Klaus Thiele - Personal & Informatik AG

 "There's got to be more to life than compile-and-go."

View raw message