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 venkat reddy <ve...@Gandiva.com> on 2001/05/17 02:02:30 UTC

setting up session id in a SOAP ENV in Client CALL.

Hi,
        I need to set a parameter in my SOAP message that has the session id
that is generated the first time a servlet is accessed. The scenario is
something like this ::

 - A servlet based session tracking is used. So the first time the servlet
is accessed a session object is created and a login page is returned to the
user. I guess the session object is also returned to the user. 
- when the user give the name/password combination and is authenticated a
index page for the application is displayed. 
- From then on any action on the index page is served using a SOAP Service
deployed on the server. The service needs the session id from the client to
process successfully. 
	So I need the session id to be setup in the SOAP ENV so that my
service can access it and verify if the session is valid. 
	My Question is how do I extract and set a session id env variable in
my incoming SOAP service call header that comes from my soap client? If
anyone has already tackled this scenario .... please post some coded example
in your reply. 

Any help is greatly appreciated. 

Thanks,
Wincat


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


Maintaining Session: Cookies?

Posted by Ethan Cerami <ec...@yahoo.com>.
I was hoping to follow up on the past few questions regarding maintaining session state.  I have two specific questions:
1.  Assuming I set the scope of my soap service to "session."  I know that this will create one new object for each client session.  Nonetheless, how are individual sessions identified?  I am using Tomcat, and in the respone, I do see several cookies set.  For example:  
Set-Cookie2: JSESSIONID=he2j9grz71;Version=1;Discard;Path="/soap"

Set-Cookie: JSESSIONID=he2j9grz71;Path=/soap

Am I correct in assuming that the SOAP server uses the cookies to identify individual sessions.  And, if so, how do I set the cookie in the Call object so that I can actually maintain state?  Even if I reuse the same Call object, the server still thinks these are three different sessions.

2.  How long will the SOAP server maintain session objects?  Is there a limit to the number of concurrent sessions?

Thanks in advance,

Ethan

 



---------------------------------
Do You Yahoo!?
Yahoo! Auctions $2 Million Sweepstakes  -  Got something to sell?

Maintaining Session: Cookies?

Posted by Ethan Cerami <ec...@yahoo.com>.
I was hoping to follow up on the past few questions regarding maintaining session state.  I have two specific questions:
1.  Assuming I set the scope of my soap service to "session."  I know that this will create one new object for each client session.  Nonetheless, how are individual sessions identified?  I am using Tomcat, and in the respone, I do see several cookies set.  For example:  
Set-Cookie2: JSESSIONID=he2j9grz71;Version=1;Discard;Path="/soap"

Set-Cookie: JSESSIONID=he2j9grz71;Path=/soap

Am I correct in assuming that the SOAP server uses the cookies to identify individual sessions.  And, if so, how do I set the cookie in the Call object so that I can actually maintain state?  Even if I reuse the same Call object, the server still thinks these are three different sessions.

2.  How long will the SOAP server maintain session objects?  Is there a limit to the number of concurrent sessions?

Thanks in advance,

Ethan

 



---------------------------------
Do You Yahoo!?
Yahoo! Auctions $2 Million Sweepstakes  -  Got something to sell?

Re: setting up session id in a SOAP ENV in Client CALL.

Posted by Michael Hudson <mh...@blueprinttech.com>.
I was succesfully able to write to a stateful session bean without rewriting my
session bean at all and I was doing something similar to what you were
stating.... however, my session bean did not need the actual session id to
operate.  With that I used the Apache SOAP 2.1's StatefulEJBProvider class on
the server side.  You may be able to write your own Provider class that derives
from the base Provider class.

Also, correct me if I'm wrong... but as long as the scope (specified in the
deployement descriptor) is set to "session" than the SOAP server will hold the
handle to the instance of your server-side object until the session is dead (all
handled by the HTTPSession, not the SOAP XML).  Thus, as long as you used the
same Call object, you should be reaching the same object.  Am I right or wrong
on this???? Anybody?

-Michael

venkat reddy wrote:

> Hi,
>         I need to set a parameter in my SOAP message that has the session id
> that is generated the first time a servlet is accessed. The scenario is
> something like this ::
>
>  - A servlet based session tracking is used. So the first time the servlet
> is accessed a session object is created and a login page is returned to the
> user. I guess the session object is also returned to the user.
> - when the user give the name/password combination and is authenticated a
> index page for the application is displayed.
> - From then on any action on the index page is served using a SOAP Service
> deployed on the server. The service needs the session id from the client to
> process successfully.
>         So I need the session id to be setup in the SOAP ENV so that my
> service can access it and verify if the session is valid.
>         My Question is how do I extract and set a session id env variable in
> my incoming SOAP service call header that comes from my soap client? If
> anyone has already tackled this scenario .... please post some coded example
> in your reply.
>
> Any help is greatly appreciated.
>
> Thanks,
> Wincat
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org

--

---------------------------------
Michael J. Hudson
Software/Framework Engineer
mhudson@blueprinttech.com

cell-phone: 703.362.8039
voice mail: 703.827.0638 ext. 4786
fax: 703.734.0987

Blueprint Technologies
"The E-Solution Architect"
http://www.blueprinttech.com



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


Re: setting up session id in a SOAP ENV in Client CALL.

Posted by Michael Hudson <mh...@blueprinttech.com>.
I was succesfully able to write to a stateful session bean without rewriting my
session bean at all and I was doing something similar to what you were
stating.... however, my session bean did not need the actual session id to
operate.  With that I used the Apache SOAP 2.1's StatefulEJBProvider class on
the server side.  You may be able to write your own Provider class that derives
from the base Provider class.

Also, correct me if I'm wrong... but as long as the scope (specified in the
deployement descriptor) is set to "session" than the SOAP server will hold the
handle to the instance of your server-side object until the session is dead (all
handled by the HTTPSession, not the SOAP XML).  Thus, as long as you used the
same Call object, you should be reaching the same object.  Am I right or wrong
on this???? Anybody?

-Michael

venkat reddy wrote:

> Hi,
>         I need to set a parameter in my SOAP message that has the session id
> that is generated the first time a servlet is accessed. The scenario is
> something like this ::
>
>  - A servlet based session tracking is used. So the first time the servlet
> is accessed a session object is created and a login page is returned to the
> user. I guess the session object is also returned to the user.
> - when the user give the name/password combination and is authenticated a
> index page for the application is displayed.
> - From then on any action on the index page is served using a SOAP Service
> deployed on the server. The service needs the session id from the client to
> process successfully.
>         So I need the session id to be setup in the SOAP ENV so that my
> service can access it and verify if the session is valid.
>         My Question is how do I extract and set a session id env variable in
> my incoming SOAP service call header that comes from my soap client? If
> anyone has already tackled this scenario .... please post some coded example
> in your reply.
>
> Any help is greatly appreciated.
>
> Thanks,
> Wincat
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org

--

---------------------------------
Michael J. Hudson
Software/Framework Engineer
mhudson@blueprinttech.com

cell-phone: 703.362.8039
voice mail: 703.827.0638 ext. 4786
fax: 703.734.0987

Blueprint Technologies
"The E-Solution Architect"
http://www.blueprinttech.com



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