protected String getCatalogURL() { String catalogLocation = (String) context.get(ToolConstants.CFG_CATALOG); return URIParserUtil.getAbsoluteURI(catalogLocation); } }
protected String getCatalogURL() { String catalogLocation = (String) context.get(ToolConstants.CFG_CATALOG); return URIParserUtil.getAbsoluteURI(catalogLocation); } }
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception { InputSource result = null; ele.setAttributeNS(null, "schemaLocation", schemaLoc); File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml"); StaxUtils.writeTo(ele, Files.newOutputStream(tmpFile.toPath())); result = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile.getAbsolutePath())); tmpFile.deleteOnExit(); return result; }
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception { InputSource result = null; ele.setAttributeNS(null, "schemaLocation", schemaLoc); File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml"); StaxUtils.writeTo(ele, Files.newOutputStream(tmpFile.toPath())); result = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile.getAbsolutePath())); tmpFile.deleteOnExit(); return result; }
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception { InputSource result = null; ele.setAttribute("schemaLocation", schemaLoc); File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml"); StaxUtils.writeTo(ele, Files.newOutputStream(tmpFile.toPath())); result = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile.getAbsolutePath())); tmpFile.deleteOnExit(); return result; }
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception { InputSource result = null; ele.setAttributeNS(null, "schemaLocation", schemaLoc); File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml"); StaxUtils.writeTo(ele, Files.newOutputStream(tmpFile.toPath())); result = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile.getAbsolutePath())); tmpFile.deleteOnExit(); return result; }
public boolean validate(String wsdlsource, String[] schemas) throws ToolException { DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); try { docFactory.setNamespaceAware(true); docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); docFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); docBuilder = docFactory.newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new ToolException(e); } String systemId = null; systemId = URIParserUtil.getAbsoluteURI(wsdlsource); InputSource is = new InputSource(systemId); return validate(is, schemas); }
public boolean validate(String wsdlsource, String[] schemas) throws ToolException { DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); try { docFactory.setNamespaceAware(true); docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); docFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); docBuilder = docFactory.newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new ToolException(e); } String systemId = null; systemId = URIParserUtil.getAbsoluteURI(wsdlsource); InputSource is = new InputSource(systemId); return validate(is, schemas); }
public Document getDocument(String wsdl) throws ToolException { try { URI wsdlURI = new URI(URIParserUtil.getAbsoluteURI(wsdl)); if (wsdlURI.toString().startsWith("http")) { return getDocument(wsdlURI.toURL()); } return getDocument(wsdlURI.toURL()); } catch (ToolException e) { throw e; } catch (Exception e) { throw new ToolException(e); } }
public Document getDocument(String wsdl) throws ToolException { try { URI wsdlURI = new URI(URIParserUtil.getAbsoluteURI(wsdl)); if (wsdlURI.toString().startsWith("http")) { return getDocument(wsdlURI.toURL()); } return getDocument(wsdlURI.toURL()); } catch (ToolException e) { throw e; } catch (Exception e) { throw new ToolException(e); } }
protected String getAbsoluteWadlURL() { String wadlURL = (String)context.get(WadlToolConstants.CFG_WADLURL); String absoluteWadlURL = URIParserUtil.getAbsoluteURI(wadlURL); context.put(WadlToolConstants.CFG_WADLURL, absoluteWadlURL); return absoluteWadlURL; }
private String getAbsoluteURI(String uri, String bindingFile) { URI locURI = null; try { locURI = new URI(uri); } catch (URISyntaxException e) { Message msg = new Message("BINDING_LOC_ERROR", LOG, new Object[] {uri}); throw new ToolException(msg); } if (!locURI.isAbsolute()) { try { String base = URIParserUtil.getAbsoluteURI(bindingFile); URI baseURI = new URI(base); locURI = baseURI.resolve(locURI); } catch (URISyntaxException e) { Message msg = new Message("NOT_URI", LOG, new Object[] {bindingFile}); throw new ToolException(msg, e); } } return locURI.toString(); }
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); } }
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); } }
String[] bindingFiles; try { wsdlURL = URIParserUtil.getAbsoluteURI((String)env.get(ToolConstants.CFG_WSDLURL));
bindingFiles[i] = URIParserUtil.getAbsoluteURI(bindingFiles[i]);
ToolContext initialContextState = context.makeCopy(); String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL); wsdlURL = URIParserUtil.getAbsoluteURI(wsdlURL);
private Definition buildCustomizedDefinition() throws Exception { Map<String, Element> eleMap = cusParser.getCustomizedWSDLElements(); String wsdlUrl = URIParserUtil.getAbsoluteURI((String)context.get(ToolConstants.CFG_WSDLURL)); CustomizedWSDLLocator wsdlLocator = new CustomizedWSDLLocator(wsdlUrl, eleMap); wsdlLocator.setCatalogResolver(OASISCatalogManager.getCatalogManager(bus)); WSDLManager mgr = bus.getExtension(WSDLManager.class); WSDLReader reader = mgr.getWSDLFactory().newWSDLReader(); reader.setFeature("javax.wsdl.verbose", false); reader.setExtensionRegistry(mgr.getExtensionRegistry()); Element el = eleMap.get(wsdlLocator.getBaseURI()); if (el == null) { el = (Element)cusParser.getWSDLNode(); } return reader.readWSDL(wsdlLocator, el); }
ToolContext initialContextState = context.makeCopy(); String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL); wsdlURL = URIParserUtil.getAbsoluteURI(wsdlURL);
builder.setBus(getBus()); context.put(Bus.class, getBus()); builder.build(URIParserUtil.getAbsoluteURI(wsdlURL)); builder.customize(); Definition definition = builder.getWSDLModel();