imp.setDefinition(resolved.getDefinition());
if (!model.getImportedDefinitions().contains(resolved)) {
model.getImportedDefinitions().add(resolved);
}
} catch (Exception e) {
ContributionResolveException ce = new ContributionResolveException(e);
error("ContributionResolveException", resolver, ce);
//throw ce;
}
} else {
if (location.startsWith("/")) {
// This is a relative URI against a contribution
location = location.substring(1);
// TODO: Need to resolve it against the contribution
} else {
// This is a relative URI against the WSDL document
URI baseURI = URI.create(model.getDefinition().getDocumentBaseURI());
URI locationURI = baseURI.resolve(location);
WSDLDefinition resolved;
try {
resolved = read(null, locationURI, locationURI.toURL());
imp.setDefinition(resolved.getDefinition());
if (!model.getImportedDefinitions().contains(resolved)) {
model.getImportedDefinitions().add(resolved);
}
} catch (Exception e) {
ContributionResolveException ce = new ContributionResolveException(e);
error("ContributionResolveException", resolver, ce);
//throw ce;
}
}
}