You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Ricardo Martin (Jira)" <ji...@apache.org> on 2022/02/08 15:57:00 UTC

[jira] [Created] (CXF-8655) Incorrect XSD resolution when the file name is the same in different folders

Ricardo Martin created CXF-8655:
-----------------------------------

             Summary: Incorrect XSD resolution when the file name is the same in different folders
                 Key: CXF-8655
                 URL: https://issues.apache.org/jira/browse/CXF-8655
             Project: CXF
          Issue Type: Bug
          Components: Simple Frontend
    Affects Versions: 3.4.5, 3.3.12, 3.5.0
            Reporter: Ricardo Martin
         Attachments: wsdl-test.zip

The attached gradle project contains a WSDL file which imports a XSD and it, in turn, imports another two XSD files with the same name but located in different directories. It triggers incorrect resolution of the XSD files. The structure is the following:
{noformat}
1) MyWebservice.wsdl
   1.1) imports schema/MyWebservice.xsd -> schema/MyWebservice.xsd
        1.1.1) imports ../../../common/common.xsd -> ../../common/common.xsd
        1.1.2) imports ../../common/common.xsd -> ../common/common.xsd
               1.1.2.1) imports ../../common/common.xsd -> ../../common/common.xsd
{noformat}
The resulting imports are:
{noformat}
1) http://localhost:8080/wsdl-test/MyWebservice?wsdl (OK)
   1.1) http://localhost:8080/wsdl-test/MyWebservice?xsd=schema/MyWebservice.xsd (OK)
        1.1.1) http://localhost:8080/wsdl-test/MyWebservice?xsd=../../common/common.xsd (KO)
        1.1.2) http://localhost:8080/wsdl-test/MyWebservice?xsd=../common/common.xsd (OK)
               1.1.2.1) http://localhost:8080/wsdl-test/MyWebservice?xsd=../../common/common.xsd (KO)
{noformat}
   
The URL {{[http://localhost:8080/wsdl-test/MyWebservice?xsd=../../common/common.xsd]}} in 1.1.1 returns invalid content. The content is the file in 1.1.2 (not 1.1.1) and besides the contained import is not rewritten in its location.
 
h3. Steps To reproduce:

 * Download attached maven project.
{code}
unzip wsdl-test.zip
cd wsdl-test/
mvn clean package
mvn jetty:run
{code}
* Go to the wsdl {{http://localhost:8080/wsdl-test/MyWebservice?wsdl}} and follow imports until {{http://localhost:8080/wsdl-test/MyWebservice?xsd=../../common/common.xsd}} and check the received output is incorrect.
* You can also execute the client while the jetty is running with:
{code}
mvn exec:java
{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)