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); } }
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); } // If we return null (as per javadoc), a NPE is raised in WSDL4J code. // So let's return new InputSource() and let WSDL4J fail. Optionally, // we can throw a similar exception as in CatalogXmlSchemaURIResolver. if (in == null) { in = new InputSource(); } return in; }
public InputSource getBaseInputSource() { InputSource result = null; if (manager != null) { try { String s = manager.resolveSystem(baseUri); if (s != null) { result = resolver.resolve(s, null); } } catch (IOException e) { //ignore } } if (result == null) { result = resolver.resolve(baseUri, null); } if (wsdlUrl == null && result != null) { wsdlUrl = result.getSystemId(); } baseUri = resolver.getURI(); return result; }
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); } // XXX: If we return null (as per javadoc), a NPE is raised in WSDL4J code. // So let's return new InputSource() and let WSDL4J fail. Optionally, // we can throw a similar exception as in CatalogXmlSchemaURIResolver. if (in == null) { in = new InputSource(); } return in; }
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); } // XXX: If we return null (as per javadoc), a NPE is raised in WSDL4J code. // So let's return new InputSource() and let WSDL4J fail. Optionally, // we can throw a similar exception as in CatalogXmlSchemaURIResolver. if (in == null) { in = new InputSource(); } return in; }
public InputSource getBaseInputSource() { InputSource result = null; if (manager != null) { try { String s = manager.resolveSystem(baseUri); if (s != null) { result = resolver.resolve(s, null); } } catch (MalformedURLException e) { //ignore } catch (IOException e) { //ignore } } if (result == null) { result = resolver.resolve(baseUri, null); } if (wsdlUrl == null && result != null) { wsdlUrl = result.getSystemId(); } baseUri = resolver.getURI(); return result; }
public InputSource getBaseInputSource() { InputSource result = null; if (manager != null) { try { String s = manager.resolveSystem(baseUri); if (s != null) { result = resolver.resolve(s, null); } } catch (MalformedURLException e) { //ignore } catch (IOException e) { //ignore } } if (result == null) { result = resolver.resolve(baseUri, null); } if (wsdlUrl == null && result != null) { wsdlUrl = result.getSystemId(); } baseUri = resolver.getURI(); return result; }
private Element loadRemotePolicy(String uri, String defName) { ExtendedURIResolver resolver = new ExtendedURIResolver(); InputSource src = resolver.resolve(uri, "classpath:"); if (null == src) { return null; } XMLStreamReader reader = null; try { reader = StaxUtils.createXMLStreamReader(src); Document doc = StaxUtils.read(reader); uri = getPolicyId(doc.getDocumentElement()); if (StringUtils.isEmpty(uri)) { Attr att = doc.createAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, "wsu:" + PolicyConstants.WSU_ID_ATTR_NAME); att.setNodeValue(defName); doc.getDocumentElement().setAttributeNodeNS(att); } return doc.getDocumentElement(); } catch (XMLStreamException e) { LOG.log(Level.WARNING, e.getMessage()); return null; } finally { try { StaxUtils.close(reader); } catch (XMLStreamException e) { LOG.log(Level.WARNING, e.getMessage()); } } }
String documentURI = pos == -1 ? uri : uri.substring(0, pos); ExtendedURIResolver resolver = new ExtendedURIResolver(); InputSource is = resolver.resolve(documentURI, baseURI); if (null == is) { return null;
InputSource source = resolver.resolve(systemId, baseURI); if (source != null) { impl = new LSInputImpl();
private Element loadRemotePolicy(String uri, String defName) { ExtendedURIResolver resolver = new ExtendedURIResolver(); InputSource src = resolver.resolve(uri, "classpath:"); if (null == src) { return null; } XMLStreamReader reader = null; try { reader = StaxUtils.createXMLStreamReader(src); Document doc = StaxUtils.read(reader); uri = getPolicyId(doc.getDocumentElement()); if (StringUtils.isEmpty(uri)) { Attr att = doc.createAttributeNS(PolicyConstants.WSU_NAMESPACE_URI, "wsu:" + PolicyConstants.WSU_ID_ATTR_NAME); att.setNodeValue(defName); doc.getDocumentElement().setAttributeNodeNS(att); } return doc.getDocumentElement(); } catch (XMLStreamException e) { LOG.log(Level.WARNING, e.getMessage()); return null; } finally { try { StaxUtils.close(reader); } catch (XMLStreamException e) { LOG.log(Level.WARNING, e.getMessage()); } } }
InputSource source = resolver.resolve(systemId, baseURI); if (source != null) { impl = new LSInputImpl();
String documentURI = pos == -1 ? uri : uri.substring(0, pos); ExtendedURIResolver resolver = new ExtendedURIResolver(); InputSource is = resolver.resolve(documentURI, baseURI); if (null == is) { return null;