You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Peter Stöckli (JIRA)" <ji...@apache.org> on 2018/04/12 09:47:00 UTC
[jira] [Updated] (CXF-7706) wsdl2java client jar generation
generates a WSDL with empty schema location
[ https://issues.apache.org/jira/browse/CXF-7706?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Stöckli updated CXF-7706:
-------------------------------
Description:
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 to fix:
Maybe don't write the {{schemaLocation}} attribute when it's empty string or null?
was:
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 to fix:
Maybe don't write the {{schemaLocation}} attribute when it's empty string or null?
> 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 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)