Author: veithen Date: Sat Dec 18 13:01:41 2010 New Revision: 1050632 URL: http://svn.apache.org/viewvc?rev=1050632&view=rev Log: The HTTP transport makes the assumption that if useSeparateListener=true, then the response is always a 202. This is not always true, e.g. when WS-RM is used. Fixed to code so that the HttpMethod is always stored in the MessageContext if the response code is not 202. This is necessary (but maybe not sufficient) to ensure proper cleanup of the connection.
Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?rev=1050632&r1=1050631&r2=1050632&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original) +++ axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Sat Dec 18 13:01:41 2010 @@ -539,9 +539,6 @@ public abstract class AbstractHTTPSender HttpMethod method) throws IOException { HostConfiguration config = this.getHostConfiguration(httpClient, msgContext, url); - if (!msgContext.getOptions().isUseSeparateListener()) - msgContext.setProperty(HTTPConstants.HTTP_METHOD, method); - // set the custom headers, if available addCustomHeaders(method, msgContext); Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java?rev=1050632&r1=1050631&r2=1050632&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java (original) +++ axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java Sat Dec 18 13:01:41 2010 @@ -266,6 +266,8 @@ public class HTTPSender extends Abstract int statusCode = method.getStatusCode(); log.trace("Handling response - " + statusCode); if (statusCode == HttpStatus.SC_OK) { + // Save the HttpMethod so that we can release the connection when cleaning up + msgContext.setProperty(HTTPConstants.HTTP_METHOD, method); processResponse(method, msgContext); } else if (statusCode == HttpStatus.SC_ACCEPTED) { /* When an HTTP 202 Accepted code has been received, this will be the case of an execution @@ -276,6 +278,8 @@ public class HTTPSender extends Abstract method.releaseConnection(); } else if (statusCode == HttpStatus.SC_INTERNAL_SERVER_ERROR || statusCode == HttpStatus.SC_BAD_REQUEST) { + // Save the HttpMethod so that we can release the connection when cleaning up + msgContext.setProperty(HTTPConstants.HTTP_METHOD, method); Header contenttypeHeader = method.getResponseHeader(HTTPConstants.HEADER_CONTENT_TYPE); String value = null;