SchemaDocument.Schema schema = schemaDocument.getSchema();
rewriteSchema(schema, contextURI, key);
String schemaString = schemaDocument.toString();
wsdlMap.put(key.toString(), schemaString);
} else if (value instanceof DefinitionsDocument) {
DefinitionsDocument doc = (DefinitionsDocument) ((DefinitionsDocument) value).copy();
TDefinitions definitions = doc.getDefinitions();
TImport[] imports = definitions.getImportArray();
for (int i = 0; i < imports.length; i++) {
TImport anImport = imports[i];
String importLocation = anImport.getLocation().trim();
if (!importLocation.startsWith("http://")) {
URI updated = buildQueryURI(contextURI, key, importLocation);
anImport.setLocation(updated.toString());
}
}
TTypes[] types = definitions.getTypesArray();
for (int i = 0; i < types.length; i++) {
TTypes type = types[i];
XmlCursor typeCursor = type.newCursor();
try {
if (typeCursor.toChild(SCHEMA_QNAME)) {
do {
SchemaDocument.Schema schema = (SchemaDocument.Schema) typeCursor.getObject();
rewriteSchema(schema, contextURI, key);
} while (typeCursor.toNextSibling(SCHEMA_QNAME));
}
} finally {
typeCursor.dispose();
}
}
wsdlMap.put(key.toString(), doc.toString());
} else {
throw new DeploymentException("Unexpected element in wsdlMap at location: " + key + ", value: " + value);
}
}
return wsdlMap;