public String getLatestImportURI() { return this.getURI(); }
public CatalogWSDLLocator(String wsdlUrl, OASISCatalogManager catalogManager) { this.baseUri = wsdlUrl; this.manager = catalogManager; this.resolver = new ExtendedURIResolver(); } public CatalogWSDLLocator(String wsdlUrl, Bus b) {
public void close() { resolver.close(); }
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 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 Policy resolveReference(String uri) { int pos = uri.indexOf('#'); String documentURI = pos == -1 ? uri : uri.substring(0, pos); ExtendedURIResolver resolver = new ExtendedURIResolver(); InputSource is = resolver.resolve(documentURI, baseURI); if (null == is) { return null; throw new PolicyException(ex); } finally { resolver.close();
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()); } } }
public String getLatestImportURI() { if (this.resolveFromMap) { return this.latestImportURI; } return resolver.getLatestImportURI(); } public InputSource getImportInputSource(String parent, String importLocation) {
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 (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 Policy resolveReference(String uri) { int pos = uri.indexOf('#'); String documentURI = pos == -1 ? uri : uri.substring(0, pos); ExtendedURIResolver resolver = new ExtendedURIResolver(); InputSource is = resolver.resolve(documentURI, baseURI); if (null == is) { return null; throw new PolicyException(ex); } finally { resolver.close();
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()); } } }
public String getLatestImportURI() { return resolver.getLatestImportURI(); }
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 String getLatestImportURI() { return this.getURI(); }
public CustomizedWSDLLocator(String wsdlUrl, Map<String, Element> map) { this.wsdlUrl = wsdlUrl; this.baseUri = this.wsdlUrl; resolver = new ExtendedURIResolver(); elementMap = map; }
public void close() { resolver.close(); } }
public String getLatestImportURI() { return resolver.getLatestImportURI(); }
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; }