1.3  PATCH: fix for NPE in CommonsHTTPSender when maintaining session and using 
a proxy
---------------------------------------------------------------------------------------

         Key: AXIS-2337
         URL: http://issues.apache.org/jira/browse/AXIS-2337
     Project: Apache Axis
        Type: Bug
  Components: Basic Architecture  
    Versions: 1.3    
 Environment: Using axis with a http proxy, maintaining session, using 
commons-httpclient, verfied on OS X 10.4 and WinXP
    Reporter: Dominik Westner
    Priority: Minor


When using CommonsHTTPSender, maintaining the session and using a proxy, invoke 
will throw a NPE, because the hostconfiguration of the commons httpclient does 
not have a host set.

Changed the source to get the information from targetURL instead of the 
hostconfiguration which seems to be more apporpriate anyway.
See patch below.

NikWest


Index: src/org/apache/axis/transport/http/CommonsHTTPSender.java
===================================================================
--- src/org/apache/axis/transport/http/CommonsHTTPSender.java   (revision 128)
+++ src/org/apache/axis/transport/http/CommonsHTTPSender.java   (working copy)
@@ -185,9 +185,9 @@
             if (msgContext.getMaintainSession()) {
                 HttpState state = httpClient.getState();
                 
method.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
-                String host = hostConfiguration.getHost();
+                String host = targetURL.getHost();
                 String path = targetURL.getPath();
-                boolean secure = hostConfiguration.getProtocol().isSecure();
+                boolean secure = 
targetURL.getProtocol().equalsIgnoreCase("https");
                 fillHeaders(msgContext, state, HTTPConstants.HEADER_COOKIE, 
host, path, secure);
                 fillHeaders(msgContext, state, HTTPConstants.HEADER_COOKIE2, 
host, path, secure);
                 httpClient.setState(state);


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to