You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2022/03/16 11:37:31 UTC

[cxf] branch 3.5.x-fixes updated (25dbe84 -> a2a48bd)

This is an automated email from the ASF dual-hosted git repository.

reta pushed a change to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 25dbe84  Updating Tomcat to 9.0.60
     new c22923c  [CXF-8655] Incorrect XSD resolution when the file name is the same in different folders (#904)
     new a2a48bd  Update Project Reactor to 3.4.16

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 parent/pom.xml                                     |  2 +-
 .../java/org/apache/cxf/frontend/WSDLGetUtils.java |  4 +++-
 .../apache/cxf/systest/jaxws/OASISCatalogTest.java | 27 ++++++++++++++++++++++
 .../others/{hello_world_schema3.xsd => common.xsd} |  6 ++---
 .../d/{hello_world_schema4.xsd => common.xsd}      | 10 ++++----
 .../d/{hello_world_schema4.xsd => shared.xsd}      | 12 ++++++----
 .../wsdl/others/hello_world_messages_catalog.wsdl  |  5 ++++
 7 files changed, 51 insertions(+), 15 deletions(-)
 copy testutils/src/main/resources/wsdl/others/{hello_world_schema3.xsd => common.xsd} (85%)
 copy testutils/src/main/resources/wsdl/others/d/{hello_world_schema4.xsd => common.xsd} (77%)
 copy testutils/src/main/resources/wsdl/others/d/{hello_world_schema4.xsd => shared.xsd} (71%)

[cxf] 02/02: Update Project Reactor to 3.4.16

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit a2a48bd789e66ffae82d35d156d02e58fbb4bb2b
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Wed Mar 16 07:36:28 2022 -0400

    Update Project Reactor to 3.4.16
    
    (cherry picked from commit 4191b6912414b7b005e88d7bbb669ced83ad345a)
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index c0ea48c..f3119c6 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -188,7 +188,7 @@
         <cxf.plexus-archiver.version>4.2.0</cxf.plexus-archiver.version>
         <cxf.plexus-utils.version>3.3.0</cxf.plexus-utils.version>
         <cxf.reactivestreams.version>1.0.3</cxf.reactivestreams.version>
-        <cxf.reactor.version>3.4.15</cxf.reactor.version>
+        <cxf.reactor.version>3.4.16</cxf.reactor.version>
         <cxf.rhino.version>1.7.13</cxf.rhino.version>
         <cxf.rxjava.version>1.3.8</cxf.rxjava.version>
         <cxf.rxjava2.version>2.2.21</cxf.rxjava2.version>

[cxf] 01/02: [CXF-8655] Incorrect XSD resolution when the file name is the same in different folders (#904)

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit c22923ce776efc203ecbae8df2228c6b064fd1f7
Author: rmartinc <rm...@redhat.com>
AuthorDate: Wed Mar 16 01:10:04 2022 +0100

    [CXF-8655] Incorrect XSD resolution when the file name is the same in different folders (#904)
---
 .../java/org/apache/cxf/frontend/WSDLGetUtils.java |  4 ++-
 .../apache/cxf/systest/jaxws/OASISCatalogTest.java | 27 ++++++++++++++++++
 .../src/main/resources/wsdl/others/common.xsd      | 27 ++++++++++++++++++
 .../src/main/resources/wsdl/others/d/common.xsd    | 30 ++++++++++++++++++++
 .../src/main/resources/wsdl/others/d/shared.xsd    | 32 ++++++++++++++++++++++
 .../wsdl/others/hello_world_messages_catalog.wsdl  |  5 ++++
 6 files changed, 124 insertions(+), 1 deletion(-)

diff --git a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
index 958b118..e724e4a 100644
--- a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
+++ b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
@@ -552,7 +552,9 @@ public class WSDLGetUtils {
                                 start), e);
             }
 
-            if (!doneSchemas.containsKey(decodedStart)) {
+            final SchemaReference doneSchema = doneSchemas.get(decodedStart);
+            if (doneSchema == null || !doneSchema.getSchemaLocationURI().equals(
+                    schemaReference.getSchemaLocationURI())) {
                 String resolvedSchemaLocation = resolveWithCatalogs(catalogs, start, base);
                 if (resolvedSchemaLocation == null) {
                     resolvedSchemaLocation =
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java
index 1ba4cf8..8596bd6 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java
@@ -62,6 +62,33 @@ public class OASISCatalogTest {
                   "SoapPort");
 
     @Test
+    public void testWSDLPublishSamePath() throws Exception {
+        Endpoint ep = Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort",
+                                       new GreeterImpl());
+
+        try {
+            String result = readUrl("http://localhost:" + PORT + "/SoapContext/SoapPort?"
+                    + "wsdl=http://apache.org/hello_world/types2/hello_world_messages_catalog.wsdl");
+            assertTrue(result, result.contains("xsd=http://apache.org/hello_world/types2/d/shared.xsd"));
+
+            result = readUrl("http://localhost:" + PORT + "/SoapContext/SoapPort?"
+                    + "xsd=http://apache.org/hello_world/types2/d/shared.xsd");
+            assertTrue(result, result.contains("xsd=http://apache.org/hello_world/types2/common.xsd"));
+            assertTrue(result, result.contains("xsd=http://apache.org/hello_world/types2/d/common.xsd"));
+
+            result = readUrl("http://localhost:" + PORT + "/SoapContext/SoapPort?"
+                    + "xsd=http://apache.org/hello_world/types2/common.xsd");
+            assertFalse(result, result.contains("schemaLocation"));
+
+            result = readUrl("http://localhost:" + PORT + "/SoapContext/SoapPort?"
+                    + "xsd=http://apache.org/hello_world/types2/d/common.xsd");
+            assertTrue(result, result.contains("xsd=http://apache.org/hello_world/types2/common.xsd"));
+        } finally {
+            ep.stop();
+        }
+    }
+
+    @Test
     public void testWSDLPublishWithCatalogs() throws Exception {
         Endpoint ep = Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort",
                                        new GreeterImpl());
diff --git a/testutils/src/main/resources/wsdl/others/common.xsd b/testutils/src/main/resources/wsdl/others/common.xsd
new file mode 100644
index 0000000..a3688d7
--- /dev/null
+++ b/testutils/src/main/resources/wsdl/others/common.xsd
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://apache.org/hello_world/common"
+            elementFormDefault="qualified">
+
+    <xsd:element name="common">
+        <xsd:complexType/>
+    </xsd:element>
+</xsd:schema>
diff --git a/testutils/src/main/resources/wsdl/others/d/common.xsd b/testutils/src/main/resources/wsdl/others/d/common.xsd
new file mode 100644
index 0000000..a778a0f
--- /dev/null
+++ b/testutils/src/main/resources/wsdl/others/d/common.xsd
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://apache.org/hello_world/d/common"
+            elementFormDefault="qualified">
+
+    <xsd:import namespace="http://apache.org/hello_world/common"
+                schemaLocation="../common.xsd"/>
+
+    <xsd:element name="dcommon">
+        <xsd:complexType/>
+    </xsd:element>
+</xsd:schema>
diff --git a/testutils/src/main/resources/wsdl/others/d/shared.xsd b/testutils/src/main/resources/wsdl/others/d/shared.xsd
new file mode 100644
index 0000000..a0772d5
--- /dev/null
+++ b/testutils/src/main/resources/wsdl/others/d/shared.xsd
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://apache.org/hello_world/d/shared"
+            elementFormDefault="qualified">
+
+    <xsd:import namespace="http://apache.org/hello_world/common"
+                schemaLocation="../common.xsd"/>
+    <xsd:import namespace="http://apache.org/hello_world/d/common"
+                schemaLocation="common.xsd"/>
+
+    <xsd:element name="dshared">
+        <xsd:complexType/>
+    </xsd:element>
+</xsd:schema>
diff --git a/testutils/src/main/resources/wsdl/others/hello_world_messages_catalog.wsdl b/testutils/src/main/resources/wsdl/others/hello_world_messages_catalog.wsdl
index 8e5290b..f84ad06 100644
--- a/testutils/src/main/resources/wsdl/others/hello_world_messages_catalog.wsdl
+++ b/testutils/src/main/resources/wsdl/others/hello_world_messages_catalog.wsdl
@@ -32,6 +32,11 @@
             <xsd:import namespace="http://apache.org/hello_world/schemas-in-separate-dir"
                         schemaLocation="http://apache.org/hello_world/schemas-in-separate-dir-non-cp/another-schema.xsd"/>
         </schema>
+        <schema targetNamespace="http://apache.org/hello_world/types2"
+                xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+            <xsd:import namespace="http://apache.org/hello_world/d/shared"
+                        schemaLocation="d/shared.xsd"/>
+        </schema>
     </wsdl:types>
     <wsdl:message name="sayHiRequest">
         <wsdl:part name="in" element="x1:sayHi"/>