continue;
}
if (imp.getLocationURI() == null) {
// FIXME: [rfeng] By the WSDL 1.1 Specification, the location attribute is required
// We need to resolve it by QName
WSDLDefinition proxy = factory.createWSDLDefinition();
proxy.setUnresolved(true);
proxy.setNamespace(imp.getNamespaceURI());
WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, proxy);
if (resolved != null && !resolved.isUnresolved()) {
imp.setDefinition(resolved.getDefinition());
if (!model.getImportedDefinitions().contains(resolved)) {
model.getImportedDefinitions().add(resolved);
}
}
} else {
String location = imp.getLocationURI();
URI uri = URI.create(location);
if (uri.isAbsolute()) {
WSDLDefinition resolved;
try {
resolved = read(null, uri, uri.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;
}
} 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);