Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-751

Multiple schema imports with the same namespace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • None
    • tools-jaxrpc
    • None

      <types>
      <xs:schema>
      <xs:import namespace="uri:tranHistory" schemaLocation="TransactionHistoryRq.xsd"/>
      <xs:import namespace="uri:tranHistory" schemaLocation="TransactionHistoryRs.xsd"/>
      <xs:import namespace="uri:tranHistory" schemaLocation="StatusRs.xsd"/>
      </xs:schema>
      </types>

      Current handling of schema imports is incorrect, since it does not allow for multiple imports with the same namespace.

      private void handleSchemaImports(Element schemaEl, URL wsdlLoc) throws MalformedURLException
      {
      if (wsdlLoc == null)
      throw new IllegalArgumentException("Cannot process import, parent location not set");

      Iterator it = DOMUtils.getChildElements(schemaEl, new QName(Constants.NS_SCHEMA_XSD, "import"));
      while (it.hasNext())
      {
      Element includeEl = (Element)it.next();
      String schemaLocation = includeEl.getAttribute("schemaLocation");
      String namespace = includeEl.getAttribute("namespace");

      log.trace("handleSchemaImport: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]");

      // Skip, let the entity resolver resolve these
      if (namespace.length() > 0 && schemaLocation.length() > 0)

      { URL currLoc = this.getLocationURL(wsdlLoc, schemaLocation); schemaLocationsMap.put(namespace, currLoc); }

      else

      { log.warn("Skip invalid schema import: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]"); }

      }
      }

              Unassigned Unassigned
              tdiesler@redhat.com Thomas Diesler
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: