cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [2/2] cxf git commit: [CXF-7183] Resolve by namespace and systemID (as required by aries)
Date Thu, 15 Dec 2016 13:29:31 GMT
[CXF-7183] Resolve by namespace and systemID (as required by aries)


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cd83ad9d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cd83ad9d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cd83ad9d

Branch: refs/heads/3.0.x-fixes
Commit: cd83ad9d117cd981823d6a5ac539e89901fff7a0
Parents: df83183
Author: Grzegorz Grzybek <gr.grzybek@gmail.com>
Authored: Thu Dec 15 13:36:41 2016 +0100
Committer: Guillaume Nodet <gnodet@apache.org>
Committed: Thu Dec 15 14:28:18 2016 +0100

----------------------------------------------------------------------
 .../cxf/internal/CXFAPINamespaceHandler.java     | 19 ++++++++++++++-----
 .../jaxrs/blueprint/JAXRSBPNamespaceHandler.java |  5 ++++-
 .../blueprint/JAXRSBPNamespaceHandler.java       |  3 ++-
 3 files changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/cd83ad9d/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java b/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java
index 7771450..07dbdb1 100644
--- a/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java
+++ b/core/src/main/java/org/apache/cxf/internal/CXFAPINamespaceHandler.java
@@ -49,15 +49,24 @@ public class CXFAPINamespaceHandler implements NamespaceHandler {
     public URL getSchemaLocation(String namespace) {
         String location = null;
 
-        if ("http://cxf.apache.org/configuration/beans".equals(namespace)) {
+        // when schema is being resolved for custom namespace elements, "namespace" is real
namespace
+        // (from xmlns:prefix="<namespace>"
+        // but when namespace is <xsd:import>ed, aries/xerces uses systemID (schemaLocation)
+
+        if ("http://cxf.apache.org/configuration/beans".equals(namespace)
+                || "http://cxf.apache.org/schemas/configuration/cxf-beans.xsd".equals(namespace))
{
             location = "schemas/configuration/cxf-beans.xsd";           
-        } else if ("http://cxf.apache.org/configuration/parameterized-types".equals(namespace))
{
+        } else if ("http://cxf.apache.org/configuration/parameterized-types".equals(namespace)
+                || "http://cxf.apache.org/schemas/configuration/parameterized-types.xsd".equals(namespace))
{
             location = "schemas/configuration/parameterized-types.xsd";
-        } else if ("http://cxf.apache.org/configuration/security".equals(namespace)) {
+        } else if ("http://cxf.apache.org/configuration/security".equals(namespace)
+                || "http://cxf.apache.org/schemas/configuration/security.xsd".equals(namespace))
{
             location = "schemas/configuration/security.xsd";
-        } else if ("http://schemas.xmlsoap.org/wsdl/".equals(namespace)) {
+        } else if ("http://schemas.xmlsoap.org/wsdl/".equals(namespace)
+                || "http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd".equals(namespace)) {
             location = "schemas/wsdl/wsdl.xsd";
-        } else if ("http://www.w3.org/2005/08/addressing".equals(namespace)) {
+        } else if ("http://www.w3.org/2005/08/addressing".equals(namespace)
+                || "http://www.w3.org/2006/03/addressing/ws-addr.xsd".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";

http://git-wip-us.apache.org/repos/asf/cxf/blob/cd83ad9d/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSBPNamespaceHandler.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSBPNamespaceHandler.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSBPNamespaceHandler.java
index 2c7aa13..ea2f919 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSBPNamespaceHandler.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/JAXRSBPNamespaceHandler.java
@@ -47,8 +47,11 @@ public class JAXRSBPNamespaceHandler extends BaseNamespaceHandler {
     }
     
     public URL getSchemaLocation(String namespace) {
-        if ("http://cxf.apache.org/blueprint/jaxrs".equals(namespace)) {
+        if ("http://cxf.apache.org/blueprint/jaxrs".equals(namespace)
+                || "http://cxf.apache.org/schemas/jaxrs.xsd".equals(namespace)) {
             return getClass().getClassLoader().getResource("schemas/blueprint/jaxrs.xsd");
+        } else if ("http://cxf.apache.org/schemas/jaxrs-common.xsd".equals(namespace)) {
+            return getClass().getClassLoader().getResource("schemas/blueprint/jaxrs-common.xsd");
         }
         return super.findCoreSchemaLocation(namespace);
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/cd83ad9d/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/JAXRSBPNamespaceHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/JAXRSBPNamespaceHandler.java
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/JAXRSBPNamespaceHandler.java
index 6a49418..fc0d1bc 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/JAXRSBPNamespaceHandler.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/JAXRSBPNamespaceHandler.java
@@ -35,9 +35,10 @@ import org.osgi.service.blueprint.reflect.Metadata;
 @Namespaces("http://cxf.apache.org/blueprint/jaxrs-client")
 public class JAXRSBPNamespaceHandler implements NamespaceHandler {
     private BlueprintContainer blueprintContainer;
-    private JAXRSBPNamespaceHandler jaxRSBPNamespaceHandler = new JAXRSBPNamespaceHandler();
+    private org.apache.cxf.jaxrs.blueprint.JAXRSBPNamespaceHandler jaxRSBPNamespaceHandler;
 
     public JAXRSBPNamespaceHandler() {
+        jaxRSBPNamespaceHandler = new org.apache.cxf.jaxrs.blueprint.JAXRSBPNamespaceHandler();
     }
     
     public URL getSchemaLocation(String namespace) {


Mime
View raw message