if (schemaRef.getSchemaLocationURI() == null) schemaRef.getSchemaLocationURI() + (schema.getDocumentBaseURI() == null ? "'." schema.getDocumentBaseURI(), schemaRef.getSchemaLocationURI()); "Unable to locate with a locator " + "the schema referenced at '" + schemaRef.getSchemaLocationURI() + "' relative to document base '" + schema.getDocumentBaseURI() + "'"); URL url = StringUtils.getURL(contextURL, schemaRef.getSchemaLocationURI()); location = url.toExternalForm(); "Unable to locate with a url " + "the document referenced at '" + schemaRef.getSchemaLocationURI() + "'" + (contextURI == null ? "." : ", relative to '" + schemaRef.getSchemaLocationURI() + "'" + (schema.getDocumentBaseURI() == null ? "." : ", relative to '"
/** * Recursively add all included schemas as schema resource. */ protected void addIncludedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError { List<SchemaReference> includes = schema.getIncludes(); for (SchemaReference schemaReference : includes) { String schemaLocation; URI locationURI = URI.create(schemaReference.getSchemaLocationURI()); if (locationURI.isAbsolute()) { schemaLocation = schemaReference.getSchemaLocationURI(); } else { schemaLocation = schema.getDocumentBaseURI().substring(0, schema.getDocumentBaseURI().lastIndexOf('/') + 1) + schemaReference.getSchemaLocationURI(); } schemaResources.add(new FileSystemResource(schemaLocation)); } }
private static void fixSchemaReferencesLocations(String basePath, Collection<SchemaReference> schemaReferences) { for (SchemaReference schemaReference : schemaReferences) { String schemaLocationURI = schemaReference.getSchemaLocationURI(); if (schemaLocationURI != null && !schemaLocationURI.startsWith(basePath) && !schemaLocationURI.startsWith(HTTP.getScheme())) { schemaReference.setSchemaLocationURI(basePath + schemaLocationURI); } } }
private String findSchemaLocation(Map<String, SchemaReference> doneSchemas, SchemaReference imp, String docBase) { String schemaLocationURI = imp.getSchemaLocationURI(); if (docBase != null && schemaLocationURI != null) { try { schemaLocationURI = getLocationURI(schemaLocationURI, docBase); } catch (Exception e) { //ignore } } if (imp.getReferencedSchema() != null) { for (Map.Entry<String, SchemaReference> e : doneSchemas.entrySet()) { if ((e.getValue().getReferencedSchema().getElement() == imp.getReferencedSchema().getElement()) && schemaLocationURI.equals(e.getKey())) { doneSchemas.put(schemaLocationURI, imp); imp.setSchemaLocationURI(e.getKey()); return e.getKey(); } } } return schemaLocationURI; }
private String findSchemaLocation(Map<String, SchemaReference> doneSchemas, SchemaReference imp, String docBase) { String schemaLocationURI = imp.getSchemaLocationURI(); if (docBase != null && schemaLocationURI != null) { try { schemaLocationURI = getLocationURI(schemaLocationURI, docBase); } catch (Exception e) { //ignore } } if (imp.getReferencedSchema() != null) { for (Map.Entry<String, SchemaReference> e : doneSchemas.entrySet()) { if ((e.getValue().getReferencedSchema().getElement() == imp.getReferencedSchema().getElement()) && schemaLocationURI.equals(e.getKey())) { doneSchemas.put(schemaLocationURI, imp); imp.setSchemaLocationURI(e.getKey()); return e.getKey(); } } } return schemaLocationURI; }
final List<SchemaReference> schemaImports = schemaImportsMap.get(importElt.getAttribute("namespace")); for (final SchemaReference schemaImport : schemaImports) { if (schemaImport.getSchemaLocationURI() != null && schemaImport.getSchemaLocationURI().equals(importElt.getAttribute("schemaLocation"))) { if (!alreadyImportedXsds.contains(schemaImport.getSchemaLocationURI())) { alreadyImportedXsds.add(schemaImport.getSchemaLocationURI()); WsdlInlineUtil.inlineImportedXsds(schemaImport.getReferencedSchema(), types, alreadyImportedXsds); types.addExtensibilityElement(schemaImport.getReferencedSchema()); if (includeElt.hasAttribute("schemaLocation")) { for (final SchemaReference schemaReference : (List<SchemaReference>) schema.getIncludes()) { if (schemaReference.getSchemaLocationURI() != null && schemaReference.getSchemaLocationURI().equals(includeElt.getAttribute("schemaLocation"))) { if (!alreadyImportedXsds.contains(schemaReference.getSchemaLocationURI())) { alreadyImportedXsds.add(schemaReference.getSchemaLocationURI()); WsdlInlineUtil.inlineImportedXsds(schemaReference.getReferencedSchema(), types, alreadyImportedXsds); types.addExtensibilityElement(schemaReference.getReferencedSchema()); if (redefineElt.hasAttribute("schemaLocation")) { for (final SchemaReference schemaReference : (List<SchemaReference>) schema.getRedefines()) { if (schemaReference.getSchemaLocationURI() != null && schemaReference.getSchemaLocationURI().equals(redefineElt.getAttribute("schemaLocation"))) { if (!alreadyImportedXsds.contains(schemaReference.getSchemaLocationURI())) { alreadyImportedXsds.add(schemaReference.getSchemaLocationURI()); WsdlInlineUtil.inlineImportedXsds(schemaReference.getReferencedSchema(), types, alreadyImportedXsds); types.addExtensibilityElement(schemaReference.getReferencedSchema());
private void mapSchema(Schema schema, String contextPath) { Map schemaImports = schema.getImports(); for (Iterator iter = schemaImports.values().iterator(); iter.hasNext();) { List imps = (List) iter.next(); for (Iterator iterator = imps.iterator(); iterator.hasNext();) { SchemaImport schemaImport = (SchemaImport) iterator.next(); Schema schemaImp = schemaImport.getReferencedSchema(); String schemaLoc = schemaImport.getSchemaLocationURI(); if (schemaLoc != null && schemaImp != null && schemaImp.getElement() != null && !URI.create(schemaLoc).isAbsolute()) { schemaLoc = resolveRelativeURI(contextPath, schemaLoc); addResource(schemaLoc, schemaImp.getElement()); // recursively map imported schemas mapSchema(schemaImp, getURIParent(schemaLoc)); } } } List schemaIncludes = schema.getIncludes(); for (Iterator iter = schemaIncludes.iterator(); iter.hasNext();) { SchemaReference schemaInclude = (SchemaReference) iter.next(); Schema schemaImp = schemaInclude.getReferencedSchema(); String schemaLoc = schemaInclude.getSchemaLocationURI(); if (schemaLoc != null && schemaImp != null && schemaImp.getElement() != null && !URI.create(schemaLoc).isAbsolute()) { schemaLoc = resolveRelativeURI(contextPath, schemaLoc); addResource(schemaLoc, schemaImp.getElement()); // recursively map included schemas mapSchema(schemaImp, getURIParent(schemaLoc)); } } }
OASISCatalogManager catalogs = OASISCatalogManager.getCatalogManager(bus); String start = findSchemaLocation(doneSchemas, schemaReference, docBase); String origLocation = schemaReference.getSchemaLocationURI(); if (resolvedSchemaLocation == null) { resolvedSchemaLocation = resolveWithCatalogs(catalogs, schemaReference.getSchemaLocationURI(), base);
OASISCatalogManager catalogs = OASISCatalogManager.getCatalogManager(bus); String start = findSchemaLocation(doneSchemas, schemaReference, docBase); String origLocation = schemaReference.getSchemaLocationURI(); if (resolvedSchemaLocation == null) { resolvedSchemaLocation = resolveWithCatalogs(catalogs, schemaReference.getSchemaLocationURI(), base);
if (o instanceof SchemaReference) { SchemaReference ref = (SchemaReference) o; String fileNameChild = normalizeName(ref.getSchemaLocationURI()); Schema includedSchema = ref.getReferencedSchema(); if (includedSchema == null) { continue; changedSchemaLocations.put(ref.getSchemaLocationURI(), fileNameChild); processSchema(definition, includedSchema, fileNameChild, changedSchemaLocations);
String start = included.getSchemaLocationURI(); String start = included.getSchemaLocationURI();
if (schemaRef.getSchemaLocationURI() == null) schemaRef.getSchemaLocationURI() + (schema.getDocumentBaseURI() == null ? "'." schema.getDocumentBaseURI(), schemaRef.getSchemaLocationURI()); "Unable to locate with a locator " + "the schema referenced at '" + schemaRef.getSchemaLocationURI() + "' relative to document base '" + schema.getDocumentBaseURI() + "'"); URL url = StringUtils.getURL(contextURL, schemaRef.getSchemaLocationURI()); location = url.toExternalForm(); "Unable to locate with a url " + "the document referenced at '" + schemaRef.getSchemaLocationURI() + "'" + (contextURI == null ? "." : ", relative to '" + schemaRef.getSchemaLocationURI() + "'" + (schema.getDocumentBaseURI() == null ? "." : ", relative to '"
if (schemaRef.getSchemaLocationURI() == null) schemaRef.getSchemaLocationURI() + (schema.getDocumentBaseURI() == null ? "'." schema.getDocumentBaseURI(), schemaRef.getSchemaLocationURI()); "Unable to locate with a locator " + "the schema referenced at '" + schemaRef.getSchemaLocationURI() + "' relative to document base '" + schema.getDocumentBaseURI() + "'"); URL url = StringUtils.getURL(contextURL, schemaRef.getSchemaLocationURI()); location = url.toExternalForm(); "Unable to locate with a url " + "the document referenced at '" + schemaRef.getSchemaLocationURI() + "'" + (contextURI == null ? "." : ", relative to '" + schemaRef.getSchemaLocationURI() + "'" + (schema.getDocumentBaseURI() == null ? "." : ", relative to '"