Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 33503 invoked from network); 28 Jun 2007 10:11:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jun 2007 10:11:58 -0000 Received: (qmail 59851 invoked by uid 500); 28 Jun 2007 10:12:00 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 59713 invoked by uid 500); 28 Jun 2007 10:11:59 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 59688 invoked by uid 500); 28 Jun 2007 10:11:59 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 59681 invoked by uid 99); 28 Jun 2007 10:11:59 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 03:11:59 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 03:11:54 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 5E7C61A981A; Thu, 28 Jun 2007 03:11:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r551523 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: Constants.java transport/http/AbstractHTTPSender.java Date: Thu, 28 Jun 2007 10:11:33 -0000 To: axis2-cvs@ws.apache.org From: deepal@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070628101134.5E7C61A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: deepal Date: Thu Jun 28 03:11:30 2007 New Revision: 551523 URL: http://svn.apache.org/viewvc?view=rev&rev=551523 Log: fixing AXIS2-2282 - By default we support JSESSIONID , if someone wants to have custom session cookie id then he need to set the following property with value as cookie name. option.setOption(Constants.CUSTOM_COOKIE_ID); Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java?view=diff&rev=551523&r1=551522&r2=551523 ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java Thu Jun 28 03:11:30 2007 @@ -223,6 +223,7 @@ public static final String COOKIE_STRING = "Cookie"; public static final String SESSION_COOKIE = "axis_session"; public static final String SESSION_COOKIE_JSESSIONID = "JSESSIONID"; + public static final String CUSTOM_COOKIE_ID = "customCookieID"; /** * Addressing Constants Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?view=diff&rev=551523&r1=551522&r2=551523 ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Thu Jun 28 03:11:30 2007 @@ -140,13 +140,17 @@ String sessionCookie = null; // Process old style headers first Header[] cookieHeaders = method.getResponseHeaders(HTTPConstants.HEADER_SET_COOKIE); + String customCoookiId = (String) msgContext.getProperty(Constants.CUSTOM_COOKIE_ID); for (int i = 0; i < cookieHeaders.length; i++) { HeaderElement[] elements = cookieHeaders[i].getElements(); for (int e = 0; e < elements.length; e++) { HeaderElement element = elements[e]; if (Constants.SESSION_COOKIE.equalsIgnoreCase(element.getName()) || Constants.SESSION_COOKIE_JSESSIONID.equalsIgnoreCase(element.getName())) { - sessionCookie = element.getValue(); + sessionCookie = processCookieHeader(element); + } + if (customCoookiId != null && customCoookiId.equalsIgnoreCase(element.getName())) { + sessionCookie = processCookieHeader(element); } } } @@ -158,7 +162,10 @@ HeaderElement element = elements[e]; if (Constants.SESSION_COOKIE.equalsIgnoreCase(element.getName()) || Constants.SESSION_COOKIE_JSESSIONID.equalsIgnoreCase(element.getName())) { - sessionCookie = element.getValue(); + sessionCookie = processCookieHeader(element); + } + if(customCoookiId!=null&&customCoookiId.equalsIgnoreCase(element.getName())){ + sessionCookie = processCookieHeader(element); } } } @@ -168,6 +175,16 @@ } } + private String processCookieHeader(HeaderElement element) { + String cookie = element.getName() + "=" + element.getValue(); + NameValuePair[] parameters = element.getParameters(); + for (int j = 0; j < parameters.length; j++) { + NameValuePair parameter = parameters[j]; + cookie = cookie + "; " + parameter.getName() + "=" + parameter.getValue(); + } + return cookie; + } + protected void processResponse(HttpMethodBase httpMethod, MessageContext msgContext) throws IOException { @@ -378,8 +395,6 @@ if (cookieString != null) { StringBuffer buffer = new StringBuffer(); - buffer.append(Constants.SESSION_COOKIE_JSESSIONID); - buffer.append("="); buffer.append(cookieString); httpMethod.setRequestHeader(HTTPConstants.HEADER_COOKIE, buffer.toString()); } --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org