cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1521396 - in /cxf/trunk/rt/transports/http-netty/netty-server/src: main/java/org/apache/cxf/transport/http/netty/server/ main/java/org/apache/cxf/transport/http/netty/server/servlet/ test/java/org/apache/cxf/transport/http/netty/server/int...
Date Tue, 10 Sep 2013 09:28:47 GMT
Author: ningjiang
Date: Tue Sep 10 09:28:47 2013
New Revision: 1521396

URL: http://svn.apache.org/r1521396
Log:
CXF-5265 Fixed the issue that Netty Http transport can handler ?wsdl request rightly

Modified:
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletHandler.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/URIParser.java
    cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/integration/NettyServerTest.java

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletHandler.java?rev=1521396&r1=1521395&r2=1521396&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletHandler.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletHandler.java
Tue Sep 10 09:28:47 2013
@@ -130,7 +130,7 @@ public class NettyHttpServletHandler ext
         NettyHttpServletRequest nettyServletRequest = 
             buildHttpServletRequest(request, nettyHttpContextHandler.getContextPath(), ctx);
 
-        nettyHttpContextHandler.handle(request.getUri(), nettyServletRequest, nettyServletResponse);
+        nettyHttpContextHandler.handle(nettyServletRequest.getRequestURI(), nettyServletRequest,
nettyServletResponse);
         interceptOnRequestSuccessed(ctx, response);
 
         nettyServletResponse.getWriter().flush();

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java?rev=1521396&r1=1521395&r2=1521396&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/NettyHttpServletRequest.java
Tue Sep 10 09:28:47 2013
@@ -83,6 +83,7 @@ public class NettyHttpServletRequest imp
         this.originalRequest = request;
         this.contextPath = contextPath;
         this.uriParser = new URIParser(contextPath);
+        uriParser.parse(request.getUri());
         this.inputStream = new NettyServletInputStream((HttpContent)request);
         this.reader = new BufferedReader(new InputStreamReader(inputStream));
         this.queryStringDecoder = new QueryStringDecoder(request.getUri());

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/URIParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/URIParser.java?rev=1521396&r1=1521395&r2=1521396&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/URIParser.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/servlet/URIParser.java
Tue Sep 10 09:28:47 2013
@@ -50,10 +50,6 @@ public class URIParser {
             this.requestUri = uri;
         }
 
-        if (this.requestUri.endsWith("/")) {
-            this.requestUri.substring(0, this.requestUri.length() - 1);
-        }
-
         if (this.pathInfo.equals("")) {
             this.pathInfo = null;
         } else if (!this.pathInfo.startsWith("/")) {

Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/integration/NettyServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/integration/NettyServerTest.java?rev=1521396&r1=1521395&r2=1521396&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/integration/NettyServerTest.java
(original)
+++ cxf/trunk/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/integration/NettyServerTest.java
Tue Sep 10 09:28:47 2013
@@ -19,10 +19,13 @@
 package org.apache.cxf.transport.http.netty.server.integration;
 
 
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
 import java.net.URL;
 import javax.xml.ws.Endpoint;
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
+import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.hello_world_soap_http.Greeter;
 import org.apache.hello_world_soap_http.SOAPService;
@@ -72,5 +75,16 @@ public class NettyServerTest extends Abs
         String response = g.greetMe("test");
         assertEquals("Get a wrong response", "Hello test", response);
     }
+    
+    @Test
+    public void testGetWsdl() throws Exception {
+        URL url = new URL("http://localhost:" + PORT + "/SoapContext/SoapPort?wsdl");
+
+        InputStream in = url.openStream();
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        IOUtils.copyAndCloseInput(in, bos);
+        String result = bos.toString();
+        assertTrue("Expect the SOAPService", result.indexOf("<service name=\"SOAPService\">")
> 0);
+    }
 
 }



Mime
View raw message