Peter Stöckli created CXF-7706: ---------------------------------- Summary: 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 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)