// Always use the URL decoded version to ensure that we have a
// canonical representation of the import URL for lookup.
try {
decodedStart = URLDecoder.decode(start, "utf-8");
} catch (UnsupportedEncodingException e) {
throw new WSDLQueryException(new org.apache.cxf.common.i18n.Message("COULD_NOT_PROVIDE_WSDL",
LOG,
start), e);
}
if (!doneSchemas.containsKey(decodedStart)) {
String resolvedSchemaLocation = resolveWithCatalogs(catalogs, start, base);
if (resolvedSchemaLocation == null) {
try {
checkSchemaUrl(doneSchemas, start, decodedStart, imp);
} catch (MalformedURLException e) {
if (doneSchemas.put(decodedStart, imp) == null) {
updateSchemaImports(imp.getReferencedSchema(), doneSchemas, base);
}
}
} else {
if (doneSchemas.put(decodedStart, imp) == null) {
doneSchemas.put(resolvedSchemaLocation, imp);
updateSchemaImports(imp.getReferencedSchema(), doneSchemas, base);
}
}
}
}
}
}
List<SchemaReference> includes = CastUtils.cast(schema.getIncludes());
for (SchemaReference included : includes) {
String start = included.getSchemaLocationURI();
if (start != null) {
String decodedStart = null;
// Always use the URL decoded version to ensure that we have a
// canonical representation of the import URL for lookup.
try {
decodedStart = URLDecoder.decode(start, "utf-8");
} catch (UnsupportedEncodingException e) {
/*throw new WSDLQueryException(new org.apache.cxf.common.i18n.Message("COULD_NOT_PROVIDE_WSDL",
LOG,
start), e); */
}
String resolvedSchemaLocation = resolveWithCatalogs(catalogs, start, base);
if (resolvedSchemaLocation == null) {
if (!doneSchemas.containsKey(decodedStart)) {
try {
checkSchemaUrl(doneSchemas, start, decodedStart, included);
} catch (MalformedURLException e) {
if (doneSchemas.put(decodedStart, included) == null) {
updateSchemaImports(included.getReferencedSchema(), doneSchemas, base);
}
}
}
} else if (!doneSchemas.containsKey(decodedStart)
|| !doneSchemas.containsKey(resolvedSchemaLocation)) {
doneSchemas.put(decodedStart, included);
doneSchemas.put(resolvedSchemaLocation, included);
updateSchemaImports(included.getReferencedSchema(), doneSchemas, base);
}
}
}
List<SchemaReference> redefines = CastUtils.cast(schema.getRedefines());
for (SchemaReference included : redefines) {
String start = included.getSchemaLocationURI();
if (start != null) {
String decodedStart = null;
// Always use the URL decoded version to ensure that we have a
// canonical representation of the import URL for lookup.
try {
decodedStart = URLDecoder.decode(start, "utf-8");
} catch (UnsupportedEncodingException e) {
throw new WSDLQueryException(new org.apache.cxf.common.i18n.Message("COULD_NOT_PROVIDE_WSDL",
LOG,
start), e);
}
String resolvedSchemaLocation = resolveWithCatalogs(catalogs, start, base);