Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 85873ECB2 for ; Tue, 12 Mar 2013 09:52:43 +0000 (UTC) Received: (qmail 4704 invoked by uid 500); 12 Mar 2013 09:52:42 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 3806 invoked by uid 500); 12 Mar 2013 09:52:38 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 3774 invoked by uid 99); 12 Mar 2013 09:52:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Mar 2013 09:52:37 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mgainty@hotmail.com designates 65.55.116.103 as permitted sender) Received: from [65.55.116.103] (HELO blu0-omc3-s28.blu0.hotmail.com) (65.55.116.103) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Mar 2013 09:52:32 +0000 Received: from BLU172-W9 ([65.55.116.72]) by blu0-omc3-s28.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 12 Mar 2013 02:52:11 -0700 X-EIP: [vaDnFDIsdYqmPjaumAxTvoQEyT/loL4fRhAsc9Lw2i4=] X-Originating-Email: [mgainty@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_59d6a2a0-20df-4d2d-959e-0f6060935aa6_" From: Martin Gainty To: "java-dev@axis.apache.org" Subject: RE: Cookie getting overwritten when client connects to multiple servers. Date: Tue, 12 Mar 2013 05:52:10 -0400 Importance: Normal In-Reply-To: <1363079887931-111999.post@n7.nabble.com> References: <1362609654256-111918.post@n7.nabble.com>,<1363079887931-111999.post@n7.nabble.com> MIME-Version: 1.0 X-OriginalArrivalTime: 12 Mar 2013 09:52:11.0980 (UTC) FILETIME=[44CC60C0:01CE1F07] X-Virus-Checked: Checked by ClamAV on apache.org --_59d6a2a0-20df-4d2d-959e-0f6060935aa6_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MG> options.setManageSession(true)=3B =20 setManageSession public void setManageSession(boolean manageSession) Set session management enabled state. When session management is enabled=2C= the engine will automatically send session data (such as the service group= id=2C or HTTP cookies) as part of requests. Parameters: manageSession - true if enabling sessions =20 you are specifically requesting your cookies be session scoped.. (not reque= st or application)=20 =20 http://axis.apache.org/axis2/java/core/api/org/apache/axis2/client/Options.= html#setManageSession(boolean) Martin- =20 > Date: Tue=2C 12 Mar 2013 02:18:07 -0700 > From: santhoshs123@gmail.com > To: java-dev@axis.apache.org > Subject: Re: Cookie getting overwritten when client connects to multiple = servers. >=20 > After more investigation found that we can get rid of this by setting uni= que > cookie names for each of the servers. If we set unique cookie names=2C ax= is > sends all those cookies to each server along with every API call. This > solution does not look that clean and if there are huge number of > servers(lets say 500) to which our client is connecting to at any given > point in time then we will end up having(and sending) 500 cookies along w= ith > each API call(if not restricted). >=20 > Later with more investigation found that Axis2 provides us a feature to > avoid overwriting of cookies with same names when connected to multiple > servers by setting the custom cookie id. By going through Axis source > code(AbstractHTTPSender.java)=2C I think Axis tries to extract the cookie= with > name Constants.CUSTOM_COOKIE_ID(set using setProperty) from the response = and > attaches it to ServiceContext so that the next request to that server wil= l > be attached with cookie extracted in previous response. >=20 > I tried doing this but was not successful in getting the expected results= =2C > still the cookies were getting overwritten. Hope and wish that I am doing > some thing wrong here=2C below is how I set Constants.CUSTOM_COOKIE_ID >=20 > ServiceClient serviceClient =3D stub._getServiceClient() > Options options =3D serviceClient.getOptions()=3B > options.setManageSession(true)=3B > options.setTimeOutInMilliSeconds(timeoutInMilliseconds)=3B > options.setProperty(Constants.CUSTOM_COOKIE_ID=2C "XXXSESSIONID")=3B > serviceClient.setOptions(options)=3B >=20 > After this I expect Axis to handle the cookie overwriting but does not se= em > like that. I feel there is something wrong the way I am setting the > property. >=20 > Guys=2C please let me know your views on this. I am completely stuck with= this > problem. >=20 > Note: we are using scope=3Dapplication and that cannot be changed. >=20 >=20 >=20 > -- > View this message in context: http://axis.8716.n7.nabble.com/Cookie-getti= ng-overwritten-when-client-connects-to-multiple-servers-tp111918p111999.htm= l > Sent from the Axis Java - Dev mailing list archive at Nabble.com. >=20 > --------------------------------------------------------------------- > To unsubscribe=2C e-mail: java-dev-unsubscribe@axis.apache.org > For additional commands=2C e-mail: java-dev-help@axis.apache.org >=20 = --_59d6a2a0-20df-4d2d-959e-0f6060935aa6_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
MG>=3B =3Boptions.setManag= eSession(true)=3B
 =3B
setManageSession
public void setManageSession(boolean manageSession)
Set session manageme= nt enabled state. When session management is enabled=2C the engine will aut= omatically send session data (such as the service group id= =2C or HTTP cookies) as part of requests.
Parameters:manageSession - true if enabling sessions
 =3B
you are specifically requesting your cookies be session scoped.. (not reque= st or application) =3B
 =3B
http://axis.apache.org/axis2/java= /core/api/org/apache/axis2/client/Options.html#setManageSession(boolean= )

Martin-

 =3B

>=3B Date: Tue=2C 12 Mar 2013 02:18:0= 7 -0700
>=3B From: santhoshs123@gmail.com
>=3B To: java-dev@axis.= apache.org
>=3B Subject: Re: Cookie getting overwritten when client co= nnects to multiple servers.
>=3B
>=3B After more investigation f= ound that we can get rid of this by setting unique
>=3B cookie names f= or each of the servers. If we set unique cookie names=2C axis
>=3B sen= ds all those cookies to each server along with every API call. This
>= =3B solution does not look that clean and if there are huge number of
&g= t=3B servers(lets say 500) to which our client is connecting to at any give= n
>=3B point in time then we will end up having(and sending) 500 cooki= es along with
>=3B each API call(if not restricted).
>=3B
>= =3B Later with more investigation found that Axis2 provides us a feature to=
>=3B avoid overwriting of cookies with same names when connected to m= ultiple
>=3B servers by setting the custom cookie id. By going through= Axis source
>=3B code(AbstractHTTPSender.java)=2C I think Axis tries = to extract the cookie with
>=3B name Constants.CUSTOM_COOKIE_ID(set us= ing setProperty) from the response and
>=3B attaches it to ServiceCont= ext so that the next request to that server will
>=3B be attached with= cookie extracted in previous response.
>=3B
>=3B I tried doing = this but was not successful in getting the expected results=2C
>=3B st= ill the cookies were getting overwritten. Hope and wish that I am doing
= >=3B some thing wrong here=2C below is how I set Constants.CUSTOM_COOKIE_= ID
>=3B
>=3B ServiceClient serviceClient =3D stub._getServiceCli= ent()
>=3B Options options =3D serviceClient.getOptions()=3B
>=3B= options.setManageSession(true)=3B
>=3B options.setTimeOutInMilliSecon= ds(timeoutInMilliseconds)=3B
>=3B options.setProperty(Constants.CUSTOM= _COOKIE_ID=2C "XXXSESSIONID")=3B
>=3B serviceClient.setOptions(options= )=3B
>=3B
>=3B After this I expect Axis to handle the cookie ove= rwriting but does not seem
>=3B like that. I feel there is something w= rong the way I am setting the
>=3B property.
>=3B
>=3B Guys= =2C please let me know your views on this. I am completely stuck with this<= BR>>=3B problem.
>=3B
>=3B Note: we are using scope=3Dapplicat= ion and that cannot be changed.
>=3B
>=3B
>=3B
>=3B = --
>=3B View this message in context: http://axis.8716.n7.nabble.com/C= ookie-getting-overwritten-when-client-connects-to-multiple-servers-tp111918= p111999.html
>=3B Sent from the Axis Java - Dev mailing list archive a= t Nabble.com.
>=3B
>=3B ----------------------------------------= -----------------------------
>=3B To unsubscribe=2C e-mail: java-dev-= unsubscribe@axis.apache.org
>=3B For additional commands=2C e-mail: ja= va-dev-help@axis.apache.org
>=3B
= --_59d6a2a0-20df-4d2d-959e-0f6060935aa6_--