Uploaded image for project: 'WS-Commons'
  1. WS-Commons
  2. WSCOMMONS-377

XmlSchemaCollection does not handle multiple imports correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • XmlSchema 1.4.3
    • XmlSchema 1.4.4
    • XmlSchema
    • None

    Description

      JAX-WS frequently generates WSDL files with the following schema import pattern:

      wsdl:

        <types>
          <xsd:schema>
            <xsd:import namespace="http://test.example.org/" schemaLocation="http://server/path/?xsd=1" />
          </xsd:schema>
          <xsd:schema>
            <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
          </xsd:schema>
        </types>
      

      xsd1:

      <xsd:schema xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.example.org/">
        <xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="http://server/path/?xsd=2" />
       <!-- element definitions -->
      </xsd:schema>
      

      xsd2:

      <xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array">
       <!-- type definitions -->
      </xsd:schema>
      

      XMLSchema cannot read both schema imports in the WSDL. It quits with

      org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection. Namespace:
      at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:139)
      at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:412)

      CXF-1624 is probably related to this bug.

      Attachments

        1. wscommons-377.zip
          4 kB
          Alexander Veit

        Activity

          People

            bmargulies Benson Margulies
            veita Alexander Veit
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: