You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Keith <ke...@gmail.com> on 2006/01/06 02:21:42 UTC

AXIS, SOAP and cookie based routing

I need to be able to set cookies on SOAP responses so that subsequent
requests will come back to the same server.  The load balancer will examine
the cookie and route subsequent requests back to the same web server.  The
cookie will be unique to the server and will not vary by session.  

 

I don't see a way with Axis to add Set-Cookie headers on HTTP responses.  Am
I just not seeing it?  Perhaps I could write a handler that handles
flowResponse and tacks on the cookie?

 

Thanks,

Keith


RE: AXIS, SOAP and cookie based routing

Posted by Keith <ke...@gmail.com>.
When you say you do support cookies do you mean setting of specific cookies
or cookies that axis uses for session management?  I am not interested in
session management.  I need to set specific cookie of the customer's
choosing.

Thanks,
Keith

-----Original Message-----
From: Deepal Jayasinghe [mailto:deepal@opensource.lk] 
Sent: Friday, January 06, 2006 6:39 AM
To: axis-user@ws.apache.org
Subject: Re: AXIS, SOAP and cookie based routing

well , axis2 support session management in current code base now , and 
session management is configurable using parameters in both server and 
client side. We do support cookie as well.

Thanks,
 Deepal
................................................................
~Future is Open~

----- Original Message ----- 
From: "iksrazal" <ik...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Friday, January 06, 2006 4:25 PM
Subject: Re: AXIS, SOAP and cookie based routing


> An alternative to cookies - which I have used successfully - would be to
> generate your own UUID and store that in a replicated cache like ehache or
> TreeCache.
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/UUID.html
>
> The idea being that on successful login, the uuid is returned and then 
> passed
> back in on subsequent requests. Its a quick, simple approach.
>
> Yet another alternative would be SimpleSessionHandler in axis 1.x and
> SeviceGroupContext in axis2 .
>
> HTH,
> iksrazal
> http://www.braziloutsource.com/
>
> Em Sexta 06 Janeiro 2006 00:37, o Keith escreveu:
>> I am not trying to use cookies to maintain session.  I want to use 
>> cookies
>> for load balancer affinity.  The idea is that every session going to a
>> server will have the same cookie -- and only my software will know what
>> name and value to use based on the server.
>>
>> When I read this it looks like Axis is creating a cookie with the name it
>> wants to use and a value that varies by sessions on the same server.
>>
>> -Keith
>>
>> -----Original Message-----
>> From: Jarmo Doc [mailto:jarmod@hotmail.com]
>> Sent: Thursday, January 05, 2006 8:06 PM
>> To: axis-user@ws.apache.org
>> Subject: RE: AXIS, SOAP and cookie based routing
>>
>> For basic session handling using cookies, at server:
>>
>> MessageContext.getCurrentContext().setMaintainSession(true)
>>
>> At client:
>>
>> XYZServiceLocator xyz_locator = new XYZServiceLocator();
>> xyz_locator.setMaintainSession(true);
>>
>> Also see:
>>
http://www.fawcette.com/javapro/2003_04/online/wsdl_kjones_04_29_03/default
>>_ pf.aspx
>>
>> >From: Keith <ke...@gmail.com>
>> >Reply-To: axis-user@ws.apache.org
>> >To: <ax...@ws.apache.org>
>> >Subject: AXIS, SOAP and cookie based routing
>> >Date: Thu, 5 Jan 2006 19:21:42 -0600
>> >
>> >I need to be able to set cookies on SOAP responses so that subsequent
>> >requests will come back to the same server.  The load balancer will
>> > examine the cookie and route subsequent requests back to the same web
>> > server.  The cookie will be unique to the server and will not vary by
>> > session.
>> >
>> >
>> >
>> >I don't see a way with Axis to add Set-Cookie headers on HTTP responses.
>> >Am
>> >I just not seeing it?  Perhaps I could write a handler that handles
>> >flowResponse and tacks on the cookie?
>> >
>> >
>> >
>> >Thanks,
>> >
>> >Keith
>>
>> _________________________________________________________________
>> Express yourself instantly with MSN Messenger! Download today - it's 
>> FREE!
>> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
> -- 
> 



Re: AXIS, SOAP and cookie based routing

Posted by Deepal Jayasinghe <de...@opensource.lk>.
well , axis2 support session management in current code base now , and 
session management is configurable using parameters in both server and 
client side. We do support cookie as well.

Thanks,
 Deepal
................................................................
~Future is Open~

----- Original Message ----- 
From: "iksrazal" <ik...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Friday, January 06, 2006 4:25 PM
Subject: Re: AXIS, SOAP and cookie based routing


> An alternative to cookies - which I have used successfully - would be to
> generate your own UUID and store that in a replicated cache like ehache or
> TreeCache.
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/UUID.html
>
> The idea being that on successful login, the uuid is returned and then 
> passed
> back in on subsequent requests. Its a quick, simple approach.
>
> Yet another alternative would be SimpleSessionHandler in axis 1.x and
> SeviceGroupContext in axis2 .
>
> HTH,
> iksrazal
> http://www.braziloutsource.com/
>
> Em Sexta 06 Janeiro 2006 00:37, o Keith escreveu:
>> I am not trying to use cookies to maintain session.  I want to use 
>> cookies
>> for load balancer affinity.  The idea is that every session going to a
>> server will have the same cookie -- and only my software will know what
>> name and value to use based on the server.
>>
>> When I read this it looks like Axis is creating a cookie with the name it
>> wants to use and a value that varies by sessions on the same server.
>>
>> -Keith
>>
>> -----Original Message-----
>> From: Jarmo Doc [mailto:jarmod@hotmail.com]
>> Sent: Thursday, January 05, 2006 8:06 PM
>> To: axis-user@ws.apache.org
>> Subject: RE: AXIS, SOAP and cookie based routing
>>
>> For basic session handling using cookies, at server:
>>
>> MessageContext.getCurrentContext().setMaintainSession(true)
>>
>> At client:
>>
>> XYZServiceLocator xyz_locator = new XYZServiceLocator();
>> xyz_locator.setMaintainSession(true);
>>
>> Also see:
>> http://www.fawcette.com/javapro/2003_04/online/wsdl_kjones_04_29_03/default
>>_ pf.aspx
>>
>> >From: Keith <ke...@gmail.com>
>> >Reply-To: axis-user@ws.apache.org
>> >To: <ax...@ws.apache.org>
>> >Subject: AXIS, SOAP and cookie based routing
>> >Date: Thu, 5 Jan 2006 19:21:42 -0600
>> >
>> >I need to be able to set cookies on SOAP responses so that subsequent
>> >requests will come back to the same server.  The load balancer will
>> > examine the cookie and route subsequent requests back to the same web
>> > server.  The cookie will be unique to the server and will not vary by
>> > session.
>> >
>> >
>> >
>> >I don't see a way with Axis to add Set-Cookie headers on HTTP responses.
>> >Am
>> >I just not seeing it?  Perhaps I could write a handler that handles
>> >flowResponse and tacks on the cookie?
>> >
>> >
>> >
>> >Thanks,
>> >
>> >Keith
>>
>> _________________________________________________________________
>> Express yourself instantly with MSN Messenger! Download today - it's 
>> FREE!
>> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
> -- 
> 



RE: AXIS, SOAP and cookie based routing

Posted by Keith <ke...@gmail.com>.
I appreciate the advice but I have to use cookies -- I don't have an
alternative.  I am not interested in session management.

The existing infrastructure is using cookies.  I need to be able to set a
specific cookie with a specific value.

I need to be able to insert the following header in the HTTP response:

Set-Cookie: MN=1, path=/

The "MN" is fixed.  The value (1 in this case) identifies the server -- so
each server will use the value that identifies it.

The browser will automatically send back the cookie in subsequent requests,
the load balancer will use that to route it back to the correct web server.

Thanks,
Keith

-----Original Message-----
From: iksrazal [mailto:iksrazal@gmail.com] 
Sent: Friday, January 06, 2006 4:25 AM
To: axis-user@ws.apache.org
Subject: Re: AXIS, SOAP and cookie based routing

An alternative to cookies - which I have used successfully - would be to 
generate your own UUID and store that in a replicated cache like ehache or 
TreeCache. 

http://java.sun.com/j2se/1.5.0/docs/api/java/util/UUID.html

The idea being that on successful login, the uuid is returned and then
passed 
back in on subsequent requests. Its a quick, simple approach. 

Yet another alternative would be SimpleSessionHandler in axis 1.x and 
SeviceGroupContext in axis2 . 

HTH,
iksrazal
http://www.braziloutsource.com/

Em Sexta 06 Janeiro 2006 00:37, o Keith escreveu:
> I am not trying to use cookies to maintain session.  I want to use cookies
> for load balancer affinity.  The idea is that every session going to a
> server will have the same cookie -- and only my software will know what
> name and value to use based on the server.
>
> When I read this it looks like Axis is creating a cookie with the name it
> wants to use and a value that varies by sessions on the same server.
>
> -Keith
>
> -----Original Message-----
> From: Jarmo Doc [mailto:jarmod@hotmail.com]
> Sent: Thursday, January 05, 2006 8:06 PM
> To: axis-user@ws.apache.org
> Subject: RE: AXIS, SOAP and cookie based routing
>
> For basic session handling using cookies, at server:
>
> MessageContext.getCurrentContext().setMaintainSession(true)
>
> At client:
>
> XYZServiceLocator xyz_locator = new XYZServiceLocator();
> xyz_locator.setMaintainSession(true);
>
> Also see:
>
http://www.fawcette.com/javapro/2003_04/online/wsdl_kjones_04_29_03/default
>_ pf.aspx
>
> >From: Keith <ke...@gmail.com>
> >Reply-To: axis-user@ws.apache.org
> >To: <ax...@ws.apache.org>
> >Subject: AXIS, SOAP and cookie based routing
> >Date: Thu, 5 Jan 2006 19:21:42 -0600
> >
> >I need to be able to set cookies on SOAP responses so that subsequent
> >requests will come back to the same server.  The load balancer will
> > examine the cookie and route subsequent requests back to the same web
> > server.  The cookie will be unique to the server and will not vary by
> > session.
> >
> >
> >
> >I don't see a way with Axis to add Set-Cookie headers on HTTP responses.
> >Am
> >I just not seeing it?  Perhaps I could write a handler that handles
> >flowResponse and tacks on the cookie?
> >
> >
> >
> >Thanks,
> >
> >Keith
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-- 


Re: AXIS, SOAP and cookie based routing

Posted by iksrazal <ik...@gmail.com>.
An alternative to cookies - which I have used successfully - would be to 
generate your own UUID and store that in a replicated cache like ehache or 
TreeCache. 

http://java.sun.com/j2se/1.5.0/docs/api/java/util/UUID.html

The idea being that on successful login, the uuid is returned and then passed 
back in on subsequent requests. Its a quick, simple approach. 

Yet another alternative would be SimpleSessionHandler in axis 1.x and 
SeviceGroupContext in axis2 . 

HTH,
iksrazal
http://www.braziloutsource.com/

Em Sexta 06 Janeiro 2006 00:37, o Keith escreveu:
> I am not trying to use cookies to maintain session.  I want to use cookies
> for load balancer affinity.  The idea is that every session going to a
> server will have the same cookie -- and only my software will know what
> name and value to use based on the server.
>
> When I read this it looks like Axis is creating a cookie with the name it
> wants to use and a value that varies by sessions on the same server.
>
> -Keith
>
> -----Original Message-----
> From: Jarmo Doc [mailto:jarmod@hotmail.com]
> Sent: Thursday, January 05, 2006 8:06 PM
> To: axis-user@ws.apache.org
> Subject: RE: AXIS, SOAP and cookie based routing
>
> For basic session handling using cookies, at server:
>
> MessageContext.getCurrentContext().setMaintainSession(true)
>
> At client:
>
> XYZServiceLocator xyz_locator = new XYZServiceLocator();
> xyz_locator.setMaintainSession(true);
>
> Also see:
> http://www.fawcette.com/javapro/2003_04/online/wsdl_kjones_04_29_03/default
>_ pf.aspx
>
> >From: Keith <ke...@gmail.com>
> >Reply-To: axis-user@ws.apache.org
> >To: <ax...@ws.apache.org>
> >Subject: AXIS, SOAP and cookie based routing
> >Date: Thu, 5 Jan 2006 19:21:42 -0600
> >
> >I need to be able to set cookies on SOAP responses so that subsequent
> >requests will come back to the same server.  The load balancer will
> > examine the cookie and route subsequent requests back to the same web
> > server.  The cookie will be unique to the server and will not vary by
> > session.
> >
> >
> >
> >I don't see a way with Axis to add Set-Cookie headers on HTTP responses.
> >Am
> >I just not seeing it?  Perhaps I could write a handler that handles
> >flowResponse and tacks on the cookie?
> >
> >
> >
> >Thanks,
> >
> >Keith
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-- 

RE: AXIS, SOAP and cookie based routing

Posted by Jarmo Doc <ja...@hotmail.com>.
Apologies, have a look at 
http://www.nabble.com/Setting-cookie-with-apache-axis-t494860.html.


>From: Keith <ke...@gmail.com>
>Reply-To: axis-user@ws.apache.org
>To: <ax...@ws.apache.org>
>Subject: RE: AXIS, SOAP and cookie based routing
>Date: Thu, 5 Jan 2006 20:37:37 -0600
>
>I am not trying to use cookies to maintain session.  I want to use cookies
>for load balancer affinity.  The idea is that every session going to a
>server will have the same cookie -- and only my software will know what 
>name
>and value to use based on the server.
>
>When I read this it looks like Axis is creating a cookie with the name it
>wants to use and a value that varies by sessions on the same server.
>
>-Keith

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


RE: AXIS, SOAP and cookie based routing

Posted by Keith <ke...@gmail.com>.
I am not trying to use cookies to maintain session.  I want to use cookies
for load balancer affinity.  The idea is that every session going to a
server will have the same cookie -- and only my software will know what name
and value to use based on the server.

When I read this it looks like Axis is creating a cookie with the name it
wants to use and a value that varies by sessions on the same server.

-Keith

-----Original Message-----
From: Jarmo Doc [mailto:jarmod@hotmail.com] 
Sent: Thursday, January 05, 2006 8:06 PM
To: axis-user@ws.apache.org
Subject: RE: AXIS, SOAP and cookie based routing

For basic session handling using cookies, at server:

MessageContext.getCurrentContext().setMaintainSession(true)

At client:

XYZServiceLocator xyz_locator = new XYZServiceLocator();
xyz_locator.setMaintainSession(true);

Also see: 
http://www.fawcette.com/javapro/2003_04/online/wsdl_kjones_04_29_03/default_
pf.aspx

>From: Keith <ke...@gmail.com>
>Reply-To: axis-user@ws.apache.org
>To: <ax...@ws.apache.org>
>Subject: AXIS, SOAP and cookie based routing
>Date: Thu, 5 Jan 2006 19:21:42 -0600
>
>I need to be able to set cookies on SOAP responses so that subsequent
>requests will come back to the same server.  The load balancer will examine
>the cookie and route subsequent requests back to the same web server.  The
>cookie will be unique to the server and will not vary by session.
>
>
>
>I don't see a way with Axis to add Set-Cookie headers on HTTP responses.  
>Am
>I just not seeing it?  Perhaps I could write a handler that handles
>flowResponse and tacks on the cookie?
>
>
>
>Thanks,
>
>Keith
>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


RE: AXIS, SOAP and cookie based routing

Posted by Jarmo Doc <ja...@hotmail.com>.
For basic session handling using cookies, at server:

MessageContext.getCurrentContext().setMaintainSession(true)

At client:

XYZServiceLocator xyz_locator = new XYZServiceLocator();
xyz_locator.setMaintainSession(true);

Also see: 
http://www.fawcette.com/javapro/2003_04/online/wsdl_kjones_04_29_03/default_pf.aspx

>From: Keith <ke...@gmail.com>
>Reply-To: axis-user@ws.apache.org
>To: <ax...@ws.apache.org>
>Subject: AXIS, SOAP and cookie based routing
>Date: Thu, 5 Jan 2006 19:21:42 -0600
>
>I need to be able to set cookies on SOAP responses so that subsequent
>requests will come back to the same server.  The load balancer will examine
>the cookie and route subsequent requests back to the same web server.  The
>cookie will be unique to the server and will not vary by session.
>
>
>
>I don't see a way with Axis to add Set-Cookie headers on HTTP responses.  
>Am
>I just not seeing it?  Perhaps I could write a handler that handles
>flowResponse and tacks on the cookie?
>
>
>
>Thanks,
>
>Keith
>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/