use of org.apache.cxf.catalog.OASISCatalogManagerHelper in project cxf by apache.
the class CustomizedWSDLLocator method resolve.
private InputSource resolve(final String target, final String base) {
try {
String resolvedLocation = new OASISCatalogManagerHelper().resolve(catalogResolver, target, base);
if (resolvedLocation == null) {
return this.resolver.resolve(target, base);
}
resolvedMap.put(target, resolvedLocation);
return this.resolver.resolve(resolvedLocation, base);
} catch (Exception e) {
throw new RuntimeException("Catalog resolve failed: ", e);
}
}
use of org.apache.cxf.catalog.OASISCatalogManagerHelper in project cxf by apache.
the class CustomizationParser method resolveByCatalog.
private String resolveByCatalog(String url) {
if (StringUtils.isEmpty(url)) {
return null;
}
Bus bus = env.get(Bus.class);
OASISCatalogManager catalogResolver = OASISCatalogManager.getCatalogManager(bus);
try {
return new OASISCatalogManagerHelper().resolve(catalogResolver, url, null);
} catch (Exception e1) {
Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
throw new ToolException(msg, e1);
}
}
use of org.apache.cxf.catalog.OASISCatalogManagerHelper in project cxf by apache.
the class WSDL11Validator method getWSDLDoc.
private Document getWSDLDoc(String wsdl) {
LOG.log(Level.FINE, new Message("VALIDATE_WSDL", LOG, wsdl).toString());
try {
OASISCatalogManager catalogResolver = OASISCatalogManager.getCatalogManager(this.getBus());
String nw = new OASISCatalogManagerHelper().resolve(catalogResolver, wsdl, null);
if (nw == null) {
nw = wsdl;
}
return new Stax2DOM().getDocument(URIParserUtil.getAbsoluteURI(nw));
} catch (FileNotFoundException fe) {
LOG.log(Level.WARNING, "Cannot find the wsdl " + wsdl + "to validate");
return null;
} catch (Exception e) {
throw new ToolException(e);
}
}
use of org.apache.cxf.catalog.OASISCatalogManagerHelper in project cxf by apache.
the class CatalogWSDLLocator method getImportInputSource.
public InputSource getImportInputSource(String parent, String importLocation) {
String resolvedImportLocation = null;
try {
resolvedImportLocation = new OASISCatalogManagerHelper().resolve(manager, importLocation, parent);
} catch (IOException e) {
throw new RuntimeException("Catalog resolution failed", e);
}
InputSource in = null;
if (resolvedImportLocation == null) {
in = this.resolver.resolve(importLocation, parent);
} else {
in = this.resolver.resolve(resolvedImportLocation, null);
}
// we can throw a similar exception as in CatalogXmlSchemaURIResolver.
if (in == null) {
in = new InputSource();
}
return in;
}
Aggregations