Hi Glen...
Attached is a simple example of stateful web service.  When I built this,
the thing that surprised me is that I need *both* this line in the
deployment descriptor:
  <parameter name="scope" value="session"/>
and this line in Client.java:
   call.setMaintainSession(true);
If you say that's "normal", then I will accept that.  I sent the email only
because I expected that the line in the DD would be sufficient all by
itself.

To run the example...
copy  StatefulService.class  to  %TOMCAT_HOME%\webapps\axis\WEB-INF\classes
java  org.apache.axis.client.AdminClient  deploy.wsdd
java  Client

If you remove the line from the deployment descriptor (above) or the line
from Client.java (above), you will not get stateful behavior.

BTW, I lived in Brookline for 20 years, and used to skateboard on a ramp in
Newton.  Good place to live.
What is DII ?
Cheers.
Stan

----- Original Message -----
From: "Glen Daniels" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 01, 2002 8:33 PM
Subject: RE: stateful web services (a minor complaint)


>
> Hola, Stan!
>
> Comments inline:
>
> > The good news is that it's very easy to develop stateful web services
> > (hooray!).  But...
> > 1.  If you write your client 'by hand' you must include this
> > statement in
> > Client.java:
> >         call.setMaintainSession(true);
> > 2.  If you generate a wsdl file and stubs, you must edit one
> > of the stubs to
> > include this statement:
> >         stub.setMaintainSession(true);
> > For more details on item 2, see the thread by Jaroslaw Balut
> > 3/20/02 ("Re:
> > How to do Stateful SOAP servers?")
> > In both cases, you need this line in the deployment descriptor:
> >      <parameter name="scope" value="session"/>
> >
> > My (minor) complaint is that items 1 and 2 should be
> > unnecessary.  It should
> > be sufficient to put the "<parameter..." line in the
> > deployment descriptor,
> > and be done with it.  I hope this complaint is not taken
>
> Well, if you write a client by hand with the DII, you really do need to
specify whether it should "deal" with sessions or not, I can't see a good
way around that (can you give me an example?  There's no deployment
descriptor in the usual case here).
>
> However, for #2, you're quite right.  We can solve this in an
Axis-specific way for now, and then as the community standards evolve for a)
maintaining session with SOAP headers, and b) expressing extensions in WSDL,
we can converge on a solution that will interoperate with SOAP::Lite, .NET,
GLUE, etc.   For now, though, we could introduce axis-specific WSDL
extensions which get automatically generated for session-scoped services and
recognized by the stub generators.
>
> Volunteers to write stuff like this are of course always appreciated. :)
>
> > negatively.  You
> > guys are doing a terrific job on Axis, and I am most
> > grateful.  Keep up the
> > good work!  :)
>
> Thanks!  Glad you like the toolkit so far, and we plan to keep making it
better/easier/faster.
>
> --Glen
>

Attachment: StatefulService.zip
Description: Zip compressed data

Reply via email to