You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Philippe Le Mouel <Ph...@oracle.com> on 2001/04/28 02:05:33 UTC

Apache soap objects life cycle

In the Apache SOAP deployment descriptor under the isd:provider XML
element, the scope attribute is used to select among several life cycle
algorithm for the SOAP object class it is applied to. For instance
consider the following SOAP deployment descriptor.

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
id="urn:Test">
  <isd:provider type="java"
                scope="Application"
                methods="test">
    <isd:java class="MyTest" static="false"/>
  </isd:provider>


<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>


</isd:service>

In this case I am setting the scope attribute to "Application". This has
the expected result. Each client method call on the SOAP object with
urn:Test is served by a unique MyTest instance. Now if I replace
"Application" by "Session" I expect that each client will be serviced by
a different MyTest instance, but all the method calls made by a single
client should be served by the same MyTest instance. Right ? I noticed
that this isn't the case for me. Even though I set the scope attribute
to be "Session" each method call made by a single client gets served by
a new MyTest instance. It seems to behave as if I set the scope
attribute to "Request". Does any body noticed similar behavior ? Is
there some other setting(s) that I am missing ? Any help would be
greatly appreciated. I am using Apache SOAP version 2.1.

Thanks a lot,
Philippe.





Re: Apache soap objects life cycle

Posted by RP Johns <rj...@vignette.com>.
There is  a way to do it with the current release, look at
the SOAPHttpConnection class, in particular, the 'maintainSession' mechanism.

If you're interested in an alternative, you could
serach the archives for post by me that
describes what I did to get session awareness. I think I even attached
the mods  (which are minimal). No claim that I have the perfect approach
but it seems to work ok for what I'm doing (mostly experimentation at this
point).

David Wall wrote:

> As you probably know, session objects only will work if the system knows
> what session a request belongs to.
>
> In the case of SOAP (right now), there's no (easy/standard) way to have
> multiple requests from the same client use the same session because the
> session id is not being handled correctly.  From what I can see, it appears
> that cookies containing the session id are being returned, but it's
> unliklely your client is retrieving them, and even less likely that you are
> putting them into the header before sending the subsequent request.  And if
> cookies are disabled, then you need to the same mechanism that servlets use
> with HttpServletResponse.encodeURL() to return the session id -- probably
> putting into the XML response document somewhere so that subsequent requests
> can get at it.
>
> Obviously, a standard scheme would be best so that everyone doesn't have to
> write a custom mechanism for handling sessions across requests.
>
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Apache soap objects life cycle

Posted by RP Johns <rj...@vignette.com>.
There is  a way to do it with the current release, look at
the SOAPHttpConnection class, in particular, the 'maintainSession' mechanism.

If you're interested in an alternative, you could
serach the archives for post by me that
describes what I did to get session awareness. I think I even attached
the mods  (which are minimal). No claim that I have the perfect approach
but it seems to work ok for what I'm doing (mostly experimentation at this
point).

David Wall wrote:

> As you probably know, session objects only will work if the system knows
> what session a request belongs to.
>
> In the case of SOAP (right now), there's no (easy/standard) way to have
> multiple requests from the same client use the same session because the
> session id is not being handled correctly.  From what I can see, it appears
> that cookies containing the session id are being returned, but it's
> unliklely your client is retrieving them, and even less likely that you are
> putting them into the header before sending the subsequent request.  And if
> cookies are disabled, then you need to the same mechanism that servlets use
> with HttpServletResponse.encodeURL() to return the session id -- probably
> putting into the XML response document somewhere so that subsequent requests
> can get at it.
>
> Obviously, a standard scheme would be best so that everyone doesn't have to
> write a custom mechanism for handling sessions across requests.
>
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


AW: Apache soap objects life cycle

Posted by Daniel Polack <dp...@delogix.de>.
Maybe this will help you ???

        call = new Call ();
        // **** Prepare for SERVER sessions *** !!!
        SOAPHTTPConnection sct = new SOAPHTTPConnection();
        sct.setMaintainSession(true);
        call.setSOAPTransport(sct);




-----Ursprüngliche Nachricht-----
Von: David Wall [mailto:dwall@Yozons.com]
Gesendet: Samstag, 28. April 2001 02:25
An: soap-user@xml.apache.org
Betreff: Re: Apache soap objects life cycle


As you probably know, session objects only will work if the system knows
what session a request belongs to.

In the case of SOAP (right now), there's no (easy/standard) way to have
multiple requests from the same client use the same session because the
session id is not being handled correctly.  From what I can see, it appears
that cookies containing the session id are being returned, but it's
unliklely your client is retrieving them, and even less likely that you are
putting them into the header before sending the subsequent request.  And if
cookies are disabled, then you need to the same mechanism that servlets use
with HttpServletResponse.encodeURL() to return the session id -- probably
putting into the XML response document somewhere so that subsequent requests
can get at it.

Obviously, a standard scheme would be best so that everyone doesn't have to
write a custom mechanism for handling sessions across requests.

David


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


AW: Apache soap objects life cycle

Posted by Daniel Polack <dp...@delogix.de>.
Maybe this will help you ???

        call = new Call ();
        // **** Prepare for SERVER sessions *** !!!
        SOAPHTTPConnection sct = new SOAPHTTPConnection();
        sct.setMaintainSession(true);
        call.setSOAPTransport(sct);




-----Ursprüngliche Nachricht-----
Von: David Wall [mailto:dwall@Yozons.com]
Gesendet: Samstag, 28. April 2001 02:25
An: soap-user@xml.apache.org
Betreff: Re: Apache soap objects life cycle


As you probably know, session objects only will work if the system knows
what session a request belongs to.

In the case of SOAP (right now), there's no (easy/standard) way to have
multiple requests from the same client use the same session because the
session id is not being handled correctly.  From what I can see, it appears
that cookies containing the session id are being returned, but it's
unliklely your client is retrieving them, and even less likely that you are
putting them into the header before sending the subsequent request.  And if
cookies are disabled, then you need to the same mechanism that servlets use
with HttpServletResponse.encodeURL() to return the session id -- probably
putting into the XML response document somewhere so that subsequent requests
can get at it.

Obviously, a standard scheme would be best so that everyone doesn't have to
write a custom mechanism for handling sessions across requests.

David


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Apache soap objects life cycle

Posted by David Wall <dw...@Yozons.com>.
As you probably know, session objects only will work if the system knows
what session a request belongs to.

In the case of SOAP (right now), there's no (easy/standard) way to have
multiple requests from the same client use the same session because the
session id is not being handled correctly.  From what I can see, it appears
that cookies containing the session id are being returned, but it's
unliklely your client is retrieving them, and even less likely that you are
putting them into the header before sending the subsequent request.  And if
cookies are disabled, then you need to the same mechanism that servlets use
with HttpServletResponse.encodeURL() to return the session id -- probably
putting into the XML response document somewhere so that subsequent requests
can get at it.

Obviously, a standard scheme would be best so that everyone doesn't have to
write a custom mechanism for handling sessions across requests.

David


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Apache soap objects life cycle

Posted by David Wall <dw...@Yozons.com>.
As you probably know, session objects only will work if the system knows
what session a request belongs to.

In the case of SOAP (right now), there's no (easy/standard) way to have
multiple requests from the same client use the same session because the
session id is not being handled correctly.  From what I can see, it appears
that cookies containing the session id are being returned, but it's
unliklely your client is retrieving them, and even less likely that you are
putting them into the header before sending the subsequent request.  And if
cookies are disabled, then you need to the same mechanism that servlets use
with HttpServletResponse.encodeURL() to return the session id -- probably
putting into the XML response document somewhere so that subsequent requests
can get at it.

Obviously, a standard scheme would be best so that everyone doesn't have to
write a custom mechanism for handling sessions across requests.

David


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org