/** * Run WSDL validation on a given file. * * @param filename * The name of the file to validate. * @throws Exception */ protected IValidationReport validateFile(String filename) { // Resolve the location of the file. String filelocation = null; try { URL fileURL = StringUtils.getURL(new URL(FILE_PREFIX + workingdir + "/"), filename); filelocation = fileURL.toExternalForm(); } catch (MalformedURLException e) { // Do nothing. The WSDL validator will handle the error. //LoggerFactory.getInstance().getLogger().log(MessageFormat.format(WSDLValidateTextUIMessages._ERROR_UNABLE_TO_READ_FILE, new Object[]{filename}), ILogger.SEV_ERROR); } // Run validation on the file. IValidationReport valReport = wsdlValidator.validate(filelocation, null, configuration); return valReport; }
/** * Parse the XML document and return the document element. * * @param uri the location of the XML document. * @param schema a String identifying related schema document. * @return a Document object. * @throws WSIException if there is a problem parsing the XML document. * @throws IOException if an I/O exception of some sort has occurred. */ public static Document parseXMLDocument(String uri, String schema) throws WSIException, IOException { URL url = StringUtils.getURL(null, uri); InputStream inputStream = (InputStream)url.getContent(); InputSource inputSource = new InputSource(inputStream); inputSource.setSystemId(url.toString()); if (schema == null) return parseXML(inputSource, false); else return parseXML(inputSource, schema); }
/** * Parse the XML document and return the document element. * * @param uri the location of the XML document. * @param schema a String identifying related schema document. * @return a Document object. * @throws WSIException if there is a problem parsing the XML document. * @throws IOException if an I/O exception of some sort has occurred. */ public static Document parseXMLDocument(String uri, String schema) throws WSIException, IOException { URL url = StringUtils.getURL(null, uri); InputStream inputStream = (InputStream)url.getContent(); InputSource inputSource = new InputSource(inputStream); inputSource.setSystemId(url.toString()); if (schema == null) return parseXML(inputSource, false); else return parseXML(inputSource, schema); }
try URL url = StringUtils.getURL(null, uddiReference.getInquiryURL()); stream = url.openStream(); stream.close();
try URL url = StringUtils.getURL(null, uddiReference.getInquiryURL()); stream = url.openStream(); stream.close();