In your service, you can access the HttpSession by doing the following.

1. Add an initial parameter of SOAPContext to each method you want to
access session data, e.g.

    String echoString(String s)

   should be changed to

    String echoString(SOAPContext ctx, String s)

2. Get the session from the SOAPContext property bag

    HTTPSession session = (HTTPSession)
ctx.getProperty(Constants.BAG_HTTPSESSION)

3. Now use the session to set or retrieve values, e.g.

    String lastString = session.getAttribute("lastString");
    session.setAttribute("lastString", s);

Scott Nichol

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 10, 2002 8:52 AM
Subject: Storing data across SOAP method invocations


> Hi there!
>
> Does anyone know how it could be done e.g. using Tomcat to store some
> Hashtables across all method invocations for a soap request? Since the
> class seems to get instantiiated every time, how it is possible to ask
for
> the values of the last invocation without having to query a database?
>
> I'd like to initialize e.g. configuration data when the first soap
request
> comes, so all others don't have to re-read from disc...
>
> thx alot
> johannes
>
>
>
>
>


------------------------------------------------------------------------
--------


> --
> To unsubscribe, e-mail:
<mailto:soap-user-unsubscribe@;xml.apache.org>
> For additional commands, e-mail:
<mailto:soap-user-help@;xml.apache.org>


--
To unsubscribe, e-mail:   <mailto:soap-user-unsubscribe@;xml.apache.org>
For additional commands, e-mail: <mailto:soap-user-help@;xml.apache.org>

Reply via email to