axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian.Be...@wettschereck-partner.de
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
documentation.

So now for everybody who probably like to try, here comes a small
explanation:
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.

server:
- 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
like:

 <handler name="session"
type="java:org.apache.axis.handlers.SimpleSessionHandler"/>
 <service name="MyService" provider="java:RPC">
  <requestFlow>
   <handler type="session"/>
  </requestFlow>
  <responseFlow>
   <handler type="session"/>
  </responseFlow>
  <parameter name="allowedMethods" value="*"/>
  <parameter name="scope" value="session"/>
  <parameter name="className" value="MyService"/>
 </service>

client:
- 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:

 <globalConfiguration>
  <requestFlow>
   <handler type="session"/>
  </requestFlow>
  <responseFlow>
   <handler type="session"/>
  </responseFlow>
 </globalConfiguration>
 <parameter name="scope" value="session"/>
 <handler name="session"
type="java:org.apache.axis.handlers.SimpleSessionHandler"/>

- 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 [mailto:kth@pi-ag.com] 
Gesendet: Freitag, 13. Dezember 2002 17:09
An: axis-user@xml.apache.org
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();
        sl.setMaintainSession(true);
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 
there.

klaus

Am Freitag, 13. Dezember 2002 16:26 schrieb 
Sebastian.Beyer@wettschereck-partner.de:
> 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
mailto:kth@pi-ag.com

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

Mime
View raw message