Author: ay
Date: Tue Jan 21 16:23:03 2014
New Revision: 1560063

URL: http://svn.apache.org/r1560063
Log:
[CXF-5506] Make ws-addressing schema available during blueprint schema 
resolution

Modified:
    cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java
    
cxf/trunk/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java
    
cxf/trunk/core/src/test/java/org/apache/cxf/internal/CXFAPINamespaceHandlerTest.java

Modified: cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java?rev=1560063&r1=1560062&r2=1560063&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java 
(original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/bus/osgi/CXFActivator.java Tue 
Jan 21 16:23:03 2014
@@ -81,7 +81,9 @@ public class CXFActivator implements Bun
                                             
"http://cxf.apache.org/configuration/beans";,
                                             
"http://cxf.apache.org/configuration/parameterized-types";,
                                             
"http://cxf.apache.org/configuration/security";,
-                                            
"http://schemas.xmlsoap.org/wsdl/";);
+                                            "http://schemas.xmlsoap.org/wsdl/";,
+                                            
"http://www.w3.org/2005/08/addressing";,
+                                            
"http://schemas.xmlsoap.org/ws/2004/08/addressing";);
 
     }
 

Modified: 
cxf/trunk/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java?rev=1560063&r1=1560062&r2=1560063&view=diff
==============================================================================
--- 
cxf/trunk/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java
 (original)
+++ 
cxf/trunk/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java
 Tue Jan 21 16:23:03 2014
@@ -42,16 +42,25 @@ import org.osgi.service.blueprint.reflec
 public class CXFAPINamespaceHandler implements NamespaceHandler {    
     
     public URL getSchemaLocation(String namespace) {
+        String location = null;
+
         if ("http://cxf.apache.org/configuration/beans".equals(namespace)) {
-            return 
getClass().getClassLoader().getResource("schemas/configuration/cxf-beans.xsd"); 
          
+            location = "schemas/configuration/cxf-beans.xsd";           
         } else if 
("http://cxf.apache.org/configuration/parameterized-types".equals(namespace)) {
-            return 
getClass().getClassLoader().getResource("schemas/configuration/parameterized-types.xsd");
+            location = "schemas/configuration/parameterized-types.xsd";
         } else if 
("http://cxf.apache.org/configuration/security".equals(namespace)) {
-            return 
getClass().getClassLoader().getResource("schemas/configuration/security.xsd");
+            location = "schemas/configuration/security.xsd";
         } else if ("http://schemas.xmlsoap.org/wsdl/".equals(namespace)) {
-            return 
getClass().getClassLoader().getResource("schemas/wsdl/wsdl.xsd");
+            location = "schemas/wsdl/wsdl.xsd";
+        } else if ("http://www.w3.org/2005/08/addressing".equals(namespace)) {
+            location = "schemas/wsdl/ws-addr.xsd";
+        } else if 
("http://schemas.xmlsoap.org/ws/2004/08/addressing".equals(namespace)) {
+            location = "schemas/wsdl/addressing.xsd";
         } else if ("http://cxf.apache.org/blueprint/core".equals(namespace)) {
-            return 
getClass().getClassLoader().getResource("schemas/blueprint/core.xsd");
+            location = "schemas/blueprint/core.xsd";
+        }
+        if (location != null) {
+            return getClass().getClassLoader().getResource(location);
         }
         return null;
     }

Modified: 
cxf/trunk/core/src/test/java/org/apache/cxf/internal/CXFAPINamespaceHandlerTest.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/core/src/test/java/org/apache/cxf/internal/CXFAPINamespaceHandlerTest.java?rev=1560063&r1=1560062&r2=1560063&view=diff
==============================================================================
--- 
cxf/trunk/core/src/test/java/org/apache/cxf/internal/CXFAPINamespaceHandlerTest.java
 (original)
+++ 
cxf/trunk/core/src/test/java/org/apache/cxf/internal/CXFAPINamespaceHandlerTest.java
 Tue Jan 21 16:23:03 2014
@@ -34,6 +34,8 @@ public class CXFAPINamespaceHandlerTest 
         
assertNotNull(handler.getSchemaLocation("http://cxf.apache.org/configuration/parameterized-types";));
         
assertNotNull(handler.getSchemaLocation("http://cxf.apache.org/configuration/security";));
         
assertNotNull(handler.getSchemaLocation("http://schemas.xmlsoap.org/wsdl/";));
+        
assertNotNull(handler.getSchemaLocation("http://www.w3.org/2005/08/addressing";));
+        
assertNotNull(handler.getSchemaLocation("http://schemas.xmlsoap.org/ws/2004/08/addressing";));
         
assertNotNull(handler.getSchemaLocation("http://cxf.apache.org/blueprint/core";));
     }
 


Reply via email to