You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/05/06 16:58:01 UTC

[jira] [Commented] (CXF-6392) Schema imports are not handled correctly in generated WSDL and XSD files

    [ https://issues.apache.org/jira/browse/CXF-6392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14530660#comment-14530660 ] 

ASF GitHub Bot commented on CXF-6392:
-------------------------------------

GitHub user TomasHofman opened a pull request:

    https://github.com/apache/cxf/pull/68

    Schema imports are not handled correctly in generated WSDL and XSD files

    Fixing issue https://issues.apache.org/jira/browse/CXF-6392
    
    - XSD files cannot be accessed by URLs that should be enabled by XML catalog rules.
    - Under some circumstances, schema location attributes in <include> elements are not rewritten to "?xsd=location" form


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/TomasHofman/cxf cxf-6392-master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cxf/pull/68.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #68
    
----
commit b9c56ad3203ab9de08335051aa2a0ffde359385f
Author: Tomas Hofman <th...@redhat.com>
Date:   2015-05-06T14:48:18Z

    [CXF-6392] Schema imports are not handled correctly in generated WSDL
    and XSD files
    
    - test case demonstrating incorrect behaviour

commit 9363620d757ca7869883fc4d2450885abd174b73
Author: Tomas Hofman <th...@redhat.com>
Date:   2015-05-06T14:48:18Z

    [CXF-6392] Schema imports are not handled correctly in generated WSDL
    and XSD files
    
    - proposed fix

----


> Schema imports are not handled correctly in generated WSDL and XSD files
> ------------------------------------------------------------------------
>
>                 Key: CXF-6392
>                 URL: https://issues.apache.org/jira/browse/CXF-6392
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>            Reporter: Tomas Hofman
>
> 1) XSD files cannot be accessed by URLs that should be enabled by XML catalog rules.
> 2) Under some circumstances, schema location attributes in <include> elements are not rewritten to "?xsd=location" form
> *Situation:*
> - We have following rule in jax-ws-catalog.xml:
> {code}
>    <rewriteSystem systemIdStartString="http://apache.org/hello_world/types2/" rewritePrefix="/wsdl/schemata/"/>
> {code}
> - We have WSDL file importing an XSD file, which in turn is including another XSD file, all located in /wsdl/ directory on classpath:
> {code}
> /wsdl/service.wsdl
> /wsdl/schemata/schema.xsd
> /wsdl/schemata/included_schema.xsd
> {code}
> - WSDL file contains import like this, with *relative path*:
> {code}
> <import namespace="http://apache.org/hello_world/types2" 
>         schemaLocation="schemata/schema.xsd"/>
> {code}
> - schema.xsd file contains following include, again with relative path:
> {code}
> <xsd:include schemaLocation="included_schema.xsd"/>
> {code}
> *Problem 1:*
> XSD file cannot be accessed by URL http://localhost:PORT/SoapContext/SoapPort?xsd=http://apache.org/hello_world/types2/schema.xsd, which is supposed to be working due to rewriteSystem rule.
> It can only be accessed with relative path URL: "?xsd=schemata/schema.xsd".
> This (meaning the first URL http://localhost:PORT/SoapContext/SoapPort?xsd=http://apache.org/hello_world/types2/schema.xsd) starts working when import in WSDL file is modified to use full URL instead of relative path:
> {code}
> <import namespace="http://apache.org/hello_world/types2" 
>         schemaLocation="http://apache.org/hello_world/types2/schema.xsd"/>
> {code}
> *Problem 2:*
> When schema.xsd is accessed by request using full url like "?xsd=http://apache.org/hello_world/types2/schema.xsd", instead of relative url, schemaLocation attribute in <import> and <include> elements in that file are not rewritten into "?xsd=..." form, so those schemaLocations cannot be followed by client.
> I'm attaching also a PR with a test case demonstrating described behaviour, and proposed fix.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)