Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7706

wsdl2java client jar generation generates a WSDL with empty schema location

    XMLWordPrintableJSON

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:

      1. Download the attached WSDL (fileDownload.wsdl) created specifically for this issue.
      2. Execute wsdl2java -d out -clientjar fileDownload.jar fileDownload.wsdl
      3. Open the fileDownload.wsdl in the root of the generated fileDownload.jar
      4. 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?

       

       

       

      Attachments

        1. fileDownload.wsdl
          3 kB
          Peter Stöckli

        Activity

          People

            Unassigned Unassigned
            pes Peter Stöckli
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: