[
https://issues.apache.org/jira/browse/CXF-5637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14276972#comment-14276972
]
Dmitry Ivanov edited comment on CXF-5637 at 1/14/15 2:57 PM:
-------------------------------------------------------------
If one xsd-file has import of another xsd-file, CXF (I'm using 2.6.14 version
in apache-tomee-plus-1.7.1) does not translate its schemaLocation.
Here I attached small example of webservice with wsdlLocation =
"WEB-INF/wsdl/NewWebService/TestService2.wsdl" in its annotation @WebService.
As you see TestService2.wsdl has xsd-import: {code:xml}<xsd:include
schemaLocation="xsd/TestService2/Func1.xsd"/>{code}
And Func1.xsd has xsd-import: {code:xml}<xsd:include
schemaLocation="../SimpleTypes.xsd"/>{code}
During runtime CXF translates only first location to: {code:xml}<xsd:include
schemaLocation="http://localhost:8080/TestWebApplication/TestService2?xsd=xsd/TestService2/Func1.xsd"/>{code}
And does not translate second.
So many code-generator can't correctly resolve and download this location
"../SimpleTypes.xsd".
Some of them try to download
"http://localhost:8080/TestWebApplication/TestService2?xsd=xsd/TestService2/Func1.xsd/../SimpleTypes.xsd"
and fail.
Another try to download
"http://localhost:8080/TestWebApplication/../SimpleTypes.xsd" and fail too...
May be you can realize Metro logic? It just numerates all xsd-imports and then
translates their schemaLocation into URL
"http://localhost:8080/TestWebApplication/TestService2?xsd=<NUMBER_OF_XSD>".
was (Author: dim666):
If one xsd-file has import of another xsd-file, CXF (I'm using 2.6.14 version
in apache-tomee-plus-1.7.1) does not translate its schemaLocation.
Here I attached small example of webservice with wsdlLocation =
"WEB-INF/wsdl/NewWebService/TestService2.wsdl" in its annotation @WebService.
As you see TestService2.wsdl has xsd-import: <xsd:include
schemaLocation="xsd/TestService2/Func1.xsd"/>
And Func1.xsd has xsd-import: <xsd:include schemaLocation="../SimpleTypes.xsd"/>
During runtime CXF translates only first location to: <xsd:include
schemaLocation="http://localhost:8080/TestWebApplication/TestService2?xsd=xsd/TestService2/Func1.xsd"/>
And does not translate second.
So many code-generator can't correctly resolve and download this location
"../SimpleTypes.xsd".
Some of them try to download
"http://localhost:8080/TestWebApplication/TestService2?xsd=xsd/TestService2/Func1.xsd/../SimpleTypes.xsd"
and fail.
Another try to download
"http://localhost:8080/TestWebApplication/../SimpleTypes.xsd" and fail too...
May be you can realize Metro logic? It just numerates all xsd-imports and then
translates their schemaLocation into URL
"http://localhost:8080/TestWebApplication/TestService2?xsd=<NUMBER_OF_XSD>".
> WSDL First approach : Xsd import in wsdl causing validation errors while
> generating client.
> -------------------------------------------------------------------------------------------
>
> Key: CXF-5637
> URL: https://issues.apache.org/jira/browse/CXF-5637
> Project: CXF
> Issue Type: Bug
> Components: JAX-WS Runtime
> Affects Versions: 2.7.5
> Reporter: Anshul Rohilla
> Fix For: NeedMoreInfo
>
> Attachments: TestWebApplication.zip
>
>
> Hey,
> I am using CXF WSDL first appraoch with which I am exposing a WSDL. This wsdl
> have many XSD imports in it. Also the imported XSD's have various XSD's
> imports.
> Now when I try to generate client from file system it works fine without
> giving any errors or warnings.
> But when I expose the same WSDL using CXF 2.7.5 JAX-WS endpoint and try
> generating client from exposed WSDL url from server, it start giving
> validating errors in imported XSD.
> I tried various methods by failed to resolve this.
> Can you please help me in this.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)