You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Jamie Tsao <jt...@atinera.com> on 2002/01/17 01:50:23 UTC

Maintaining Session using JSESSION ??

Hi,
 
I've read a few postings about maintaining session in Apache SOAP, and it appears that you can do so as long as the client uses the same Call object.  On the server side, you just have your first parameter as SOAPContext.
 
My problem is that my clients are NOT using Apache SOAP.  My service simply expects a SOAP Message such as:
 
<SOAP-ENV:Envelope xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi=" http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/1999/XMLSchema">
  <SOAP-ENV:Body>
    <searchFlights xmlns="urn:Service" SOAP-ENV:encodingStyle=" http://xml.apache.org/xml-soap/literalxml">
        <data>
           <departureAiport>SFO</departureAirport>
           <blah blah blah />
        </data>
    </searchFlights>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
I'm using literal encoding, and my service method simply manipulates the XML payload using JDOM, and performs some business logic.  Therefore, the client can create this message any way they want (i.e. NOT using Apache API).
 
How can I maintain session state in this situation ?  I noticed that my reply SOAP header contains the HttpSession id (JSESSION), but a different value is returned each time (why ?).  Can the client somehow include this JSESSION id to maintain state.  If so, how ?  How do I use this JSESSION id to retrieve the previous HttpSession ?
 
I hope someone has an answer, otherwise i'm screwed !!!
 
Thanks