[CXF-5623] If a wsdl imports a schema directly using a wsdl:import instead of wsdl:types/xsd:schema/xsd:import, then try to detect that and use the appropriate schema systemId instead of a generated one.
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/142d423e Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/142d423e Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/142d423e Branch: refs/heads/2.6.x-fixes Commit: 142d423e993343de0273f7b90f1d47000cfa6815 Parents: aaaf1a5 Author: Daniel Kulp <[email protected]> Authored: Thu Mar 20 11:31:39 2014 -0400 Committer: Daniel Kulp <[email protected]> Committed: Thu Mar 20 16:45:29 2014 -0400 ---------------------------------------------------------------------- rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/142d423e/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java ---------------------------------------------------------------------- diff --git a/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java b/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java index 489a471..0919dfc 100644 --- a/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java +++ b/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java @@ -124,6 +124,14 @@ public final class SchemaUtil { } } String systemId = def.getDocumentBaseURI() + "#types" + schemaCount; + if (def.getDocumentBaseURI() != null + && def.getDocumentBaseURI().toUpperCase().endsWith(".xsd") + && def.getTargetNamespace() == null + && (obj == null + || !(obj instanceof Schema + || !((Schema)obj).getDocumentBaseURI().equals(def.getDocumentBaseURI())))) { + systemId = def.getDocumentBaseURI(); + } schemaCol.setBaseUri(def.getDocumentBaseURI()); CatalogXmlSchemaURIResolver schemaResolver =
