cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r941316 - in /cxf/branches/2.2.x-fixes: ./ api/src/main/java/org/apache/cxf/transport/ rt/core/src/main/java/org/apache/cxf/transport/http/ rt/core/src/test/java/org/apache/cxf/wsdl11/ rt/core/src/test/resources/folder with spaces/ rt/core/...
Date Wed, 05 May 2010 14:41:07 GMT
Author: dkulp
Date: Wed May  5 14:41:06 2010
New Revision: 941316

URL: http://svn.apache.org/viewvc?rev=941316&view=rev
Log:
Merged revisions 941315 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r941315 | dkulp | 2010-05-05 10:38:29 -0400 (Wed, 05 May 2010) | 2 lines
  
  [CXF-2767] More fixes for spaces in dirs
  Patch from William Tam applied
........

Added:
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/folder with spaces/
      - copied from r941315, cxf/trunk/rt/core/src/test/resources/folder with spaces/
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/folder with spaces/import_test.wsdl
      - copied unchanged from r941315, cxf/trunk/rt/core/src/test/resources/folder with spaces/import_test.wsdl
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/schema/
      - copied from r941315, cxf/trunk/rt/core/src/test/resources/schema/
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/schema/folder with spaces/
      - copied from r941315, cxf/trunk/rt/core/src/test/resources/schema/folder with spaces/
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/schema/folder with spaces/Schema1_In.xsd
      - copied unchanged from r941315, cxf/trunk/rt/core/src/test/resources/schema/folder
with spaces/Schema1_In.xsd
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/schema/folder with spaces/Schema1_Out.xsd
      - copied unchanged from r941315, cxf/trunk/rt/core/src/test/resources/schema/folder
with spaces/Schema1_Out.xsd
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/schema/folder with spaces/Schema2_In.xsd
      - copied unchanged from r941315, cxf/trunk/rt/core/src/test/resources/schema/folder
with spaces/Schema2_In.xsd
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/schema/folder with spaces/Schema2_Out.xsd
      - copied unchanged from r941315, cxf/trunk/rt/core/src/test/resources/schema/folder
with spaces/Schema2_Out.xsd
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/schema/folder with spaces/Schema3_In.xsd
      - copied unchanged from r941315, cxf/trunk/rt/core/src/test/resources/schema/folder
with spaces/Schema3_In.xsd
    cxf/branches/2.2.x-fixes/rt/core/src/test/resources/schema/folder with spaces/Schema3_Out.xsd
      - copied unchanged from r941315, cxf/trunk/rt/core/src/test/resources/schema/folder
with spaces/Schema3_Out.xsd
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
    cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilderTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java?rev=941316&r1=941315&r2=941316&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java
(original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java
Wed May  5 14:41:06 2010
@@ -61,6 +61,10 @@ public class TransportURIResolver extend
     }
     
     public InputSource resolve(String curUri, String baseUri) {
+        
+        // Spaces must be encoded or URI.resolve() will choke
+        curUri = curUri.replace(" ", "%20");
+        
         InputSource is = null;
         URI base;
         try {

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java?rev=941316&r1=941315&r2=941316&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
Wed May  5 14:41:06 2010
@@ -119,7 +119,14 @@ public class WSDLQueryHandler implements
             }
 
             String wsdl = params.get("wsdl");
+            if (wsdl != null) {
+                wsdl = wsdl.replace("%20", " ");
+            }
+            
             String xsd =  params.get("xsd");
+            if (xsd != null) {
+                xsd = xsd.replace("%20", " ");
+            }
             
             Map<String, Definition> mp = CastUtils.cast((Map)endpointInfo.getService()
                                                         .getProperty(WSDLQueryHandler.class.getName()));
@@ -241,7 +248,7 @@ public class WSDLQueryHandler implements
         for (Element el : elementList) {
             String sl = el.getAttribute("schemaLocation");
             if (smp.containsKey(sl)) {
-                el.setAttribute("schemaLocation", base + "?xsd=" + sl);
+                el.setAttribute("schemaLocation", base + "?xsd=" + sl.replace(" ", "%20"));
             }
         }
         
@@ -251,7 +258,7 @@ public class WSDLQueryHandler implements
         for (Element el : elementList) {
             String sl = el.getAttribute("schemaLocation");
             if (smp.containsKey(sl)) {
-                el.setAttribute("schemaLocation", base + "?xsd=" + sl);
+                el.setAttribute("schemaLocation", base + "?xsd=" + sl.replace(" ", "%20"));
             }
         }
         elementList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
@@ -260,7 +267,7 @@ public class WSDLQueryHandler implements
         for (Element el : elementList) {
             String sl = el.getAttribute("schemaLocation");
             if (smp.containsKey(sl)) {
-                el.setAttribute("schemaLocation", base + "?xsd=" + sl);
+                el.setAttribute("schemaLocation", base + "?xsd=" + sl.replace(" ", "%20"));
             }
         }
         elementList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
@@ -269,7 +276,7 @@ public class WSDLQueryHandler implements
         for (Element el : elementList) {
             String sl = el.getAttribute("location");
             if (mp.containsKey(sl)) {
-                el.setAttribute("location", base + "?wsdl=" + sl);
+                el.setAttribute("location", base + "?wsdl=" + sl.replace(" ", "%20"));
             }
         }
         

Modified: cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilderTest.java?rev=941316&r1=941315&r2=941316&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilderTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilderTest.java
Wed May  5 14:41:06 2010
@@ -103,4 +103,28 @@ public class WSDLDefinitionBuilderTest e
         assertNotNull(part);
         assertEquals(new QName("http://apache.org/hello_world/types", "sayHi"), part.getElementName());
     }    
+    
+    @Test
+    public void testBuildImportedWSDLSpacesInPath() throws Exception {
+        WSDLDefinitionBuilder builder = new WSDLDefinitionBuilder(BusFactory.getDefaultBus());
+        String wsdlUrl = getClass().getResource("/folder with spaces/import_test.wsdl").toString();
+
+        Definition def = builder.build(wsdlUrl);
+        assertNotNull(def);
+        
+        Map services = def.getServices();
+        assertNotNull(services);
+        assertEquals(1, services.size());
+
+        String serviceQName = "urn:S1importS2S3/resources/wsdl/S1importsS2S3Test1";
+        Service service = (Service)services.get(new QName(serviceQName, "S1importsS2S3TestService"));
+        assertNotNull(service);
+        
+        Map ports = service.getPorts();
+        assertNotNull(ports);
+        assertEquals(1, ports.size());
+        Port port = service.getPort("S1importsS2S3TestPort");
+        assertNotNull(port);
+    }
+    
 }



Mime
View raw message