Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.2.4
-
None
-
None
-
Unknown
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:
<xs:import namespace="http://www.w3.org/2005/05/xmlmime" schemaLocation=""/>
This leads to following exception at runtime:
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.
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?