[
https://issues.apache.org/jira/browse/CXF-7706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445945#comment-16445945
]
Dmitry Volodin commented on CXF-7706:
-------------------------------------
Looks like a chance to fix this is very low, as CXF is using WSDL4J
implementation for parsing and processing and this is a bug [PI34919: WSDL4J
THROWS WSDLEXCEPTION CAUSED BY SAXPARSEEXCEPTION WHEN
SCHEMALOCATION=""|http://www-01.ibm.com/support/docview.wss?uid=swg1PI34919]
which has been fixed internally in IBM but not published as this library has no
roadmap.
> wsdl2java client jar generation generates a WSDL with empty schema location
> ---------------------------------------------------------------------------
>
> Key: CXF-7706
> URL: https://issues.apache.org/jira/browse/CXF-7706
> Project: CXF
> Issue Type: Bug
> Affects Versions: 3.2.4
> Reporter: Peter Stöckli
> Priority: Major
> Labels: wsdl2java
> Attachments: fileDownload.wsdl
>
>
> When generating a client Jar with wsdl2java it can happen that the resulting
> WSDL in the clientjar contains an import with an empty schema location:
> {color:#800000}<xs:import{color}
> {color:#ff0000}namespace{color}{color:#000000}={color}{color:#0000ff}"http://www.w3.org/2005/05/xmlmime"{color}
>
> {color:#ff0000}schemaLocation{color}{color:#000000}={color}{color:#0000ff}""{color}{color:#800000}/>{color}
> This leads to following exception at runtime:
>
> {code:java}
> javax.wsdl.WSDLException: WSDLException (at
> /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem
> parsing
> 'jar:file:/<file-path>/fileDownload.jar!/org/example/filedownload/client/'.:
> org.xml.sax.SAXParseException: Premature end of file.{code}
>
> If we edit the WSDL in the clientjar and remove the attribute
> {{schemaLocation}} on the import tag the runtime the WSDLException does not
> occur anymore.
>
> How to reproduce:
> # Download the attached WSDL (fileDownload.wsdl) created specifically for
> this issue.
> # Execute {{wsdl2java -d out -clientjar fileDownload.jar fileDownload.wsdl}}
> # Open the fileDownload.wsdl in the root of the generated fileDownload.jar
> # Now you should see the line: {{<xs:import
> namespace="http://www.w3.org/2005/05/xmlmime" schemaLocation=""/>}} (Note the
> empty schema location)
>
> Idea on how to fix:
> Maybe don't write the {{schemaLocation}} attribute when it's empty string or
> null?
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)