You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by he...@apache.org on 2005/06/29 11:00:32 UTC

svn commit: r202340 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/ core/src/org/apache/axis/transport/http/ samples/ samples/test/org/apache/axis/engine/

Author: hemapani
Date: Wed Jun 29 02:00:31 2005
New Revision: 202340

URL: http://svn.apache.org/viewcvs?rev=202340&view=rev
Log:
fixed the CommonsHTTP and include the test case

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/CommonsHTTPTransportSender.java
    webservices/axis/trunk/java/modules/samples/maven.xml
    webservices/axis/trunk/java/modules/samples/project.xml
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java?rev=202340&r1=202339&r2=202340&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java Wed Jun 29 02:00:31 2005
@@ -183,6 +183,7 @@
     public static final String CONTAINER_MANAGED = "ContainerManaged";
     public static final String RESPONSE_WRITTEN = "CONTENT_WRITTEN";
     
+    
     public static final String TESTING_PATH = "target/test-resources/"; 
     //public static final String TESTING_PATH = "modules/samples/target/test-resources/";
    

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/CommonsHTTPTransportSender.java?rev=202340&r1=202339&r2=202340&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/CommonsHTTPTransportSender.java Wed Jun 29 02:00:31 2005
@@ -27,6 +27,7 @@
 import org.apache.commons.httpclient.HostConfiguration;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.HttpStatus;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.commons.httpclient.methods.RequestEntity;
@@ -35,9 +36,9 @@
     private boolean chuncked = false;
     private boolean doMTOM = false;
     private String httpVersion = HTTPConstants.HEADER_PROTOCOL_10;
-    public static final String TRANSPORT_SENDER_INFO = "TRANSPORT_SENDER_INFO";
+    public static final String HTTP_METHOD = "HTTP_METHOD";
 
-    protected PostMethod postMethod;
+    
     protected HttpClient httpClient;
     protected OMElement outputMessage;
     protected boolean doREST;
@@ -106,6 +107,8 @@
             String soapActionString = soapAction == null ? "" : soapAction.toString();
 
             PostMethod postMethod = new PostMethod();
+            postMethod.setPath(url.getFile());
+            msgContext.setProperty(HTTP_METHOD,postMethod);
             postMethod.setRequestEntity(new AxisRequestEntity(dataout, chuncked));
             if (!httpVersion.equals(HTTPConstants.HEADER_PROTOCOL_10) && chuncked) {
                 ((PostMethod) postMethod).setContentChunked(true);
@@ -152,7 +155,7 @@
 
             //code that wirte the stream to the wire
 
-            this.httpClient.executeMethod(hostConfig, this.postMethod);
+            this.httpClient.executeMethod(hostConfig, postMethod);
             if(postMethod.getStatusCode() == HttpStatus.SC_OK){
                 InputStream in = postMethod.getResponseBodyAsStream();
                 if(in == null){
@@ -258,7 +261,10 @@
      * @see org.apache.axis.transport.TransportSender#cleanUp(org.apache.axis.context.MessageContext)
      */
     public void cleanUp(MessageContext msgContext) throws AxisFault {
-        ((PostMethod) this.postMethod).releaseConnection();
+        HttpMethod httpMethod = (HttpMethod)msgContext.getProperty(HTTP_METHOD);
+        if(httpMethod != null){
+            httpMethod.releaseConnection();
+        }
 
     }
 

Modified: webservices/axis/trunk/java/modules/samples/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/maven.xml?rev=202340&r1=202339&r2=202340&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/maven.xml (original)
+++ webservices/axis/trunk/java/modules/samples/maven.xml Wed Jun 29 02:00:31 2005
@@ -32,7 +32,7 @@
         
       <!-- Commons transport enabled enabled Repository -->
         <mkdir dir="target/test-resources/commons-http-enabledRepository"/>
-        <copy file="test/org/apache/axis/engine/chuncking-enabled-axis2.xml" 
+        <copy file="test/org/apache/axis/engine/commons-http-enabled-axis2.xml" 
         tofile="target/test-resources/commons-http-enabledRepository/axis2.xml"/>        
     </postGoal>
 

Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=202340&r1=202339&r2=202340&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Wed Jun 29 02:00:31 2005
@@ -66,6 +66,15 @@
             </properties>
 		<url>http://dist.codehaus.org/stax/jars/</url>
         </dependency>
+        <dependency>
+           <groupId>commons-httpclient</groupId>
+           <artifactId>commons-httpclient</artifactId>
+           <version>3.0-rc2</version>
+           <properties>
+               <module>true</module>
+           </properties>
+       </dependency>
+        
 	<dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
@@ -128,7 +137,7 @@
 		<exclude>**/*MailOneWayRawXMLTest.java</exclude> 
 		<exclude>**/*MailRequestResponseRawXMLTest.java</exclude> 
 		<exclude>**/*EchoRawXMLChunckedTest.java</exclude> 
-		<exclude>**/*CommonsHTTPEchoRawXMLTest.java</exclude> 
+		<!-- <exclude>**/*CommonsHTTPEchoRawXMLTest.java</exclude>  -->
 		<exclude>**/*EchoRawMTOMTest.java</exclude> 
       </excludes>
      <includes>

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java?rev=202340&r1=202339&r2=202340&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java Wed Jun 29 02:00:31 2005
@@ -43,7 +43,7 @@
     private EndpointReference targetEPR =
             new EndpointReference(AddressingConstants.WSA_TO,
                     "http://127.0.0.1:"
-            + (UtilServer.TESTING_PORT+1)
+            + (UtilServer.TESTING_PORT)
             + "/axis/services/EchoXMLService/echoOMElement");
     private Log log = LogFactory.getLog(getClass());
     private QName serviceName = new QName("EchoXMLService");