Peter Stöckli created CXF-7706:

             Summary: wsdl2java client jar generation generates a WSDL with 
empty schema location
                 Key: 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:

This leads to following exception at runtime:

javax.wsdl.WSDLException: WSDLException (at 
/wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem 
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 
 # 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=""; schemaLocation=""/>}} (Note the 
empty schema location)


Idea to fix:

Maybe don't write the {{schemaLocation}} attribute when it's empty string or 




This message was sent by Atlassian JIRA

Reply via email to