@Test public void readFromURL() throws MalformedURLException, Exception { boolean b = IsReachable("http: if (!b) { System.out.println("Skipping test for a remote WSDL due to connectivity problems"); } org.junit.Assume.assumeTrue(b); ReadWSDL readWSDL = new ReadWSDL(); Definition definition = null; try { definition = readWSDL.readWSDL(new URL("http: Assert.assertNotNull(definition); } catch (UnknownHostException ex) { } }
public Definition readWSDL(String fileName) throws WSDLException { Definition wsdlDefinition = null; WSDLFactory factory = WSDLFactoryImpl.newInstance(); WSDLReader reader = factory.newWSDLReader(); try { File f = new File(fileName); URL url = null; if (f.exists()) { log.info(fileName + " as a local file doesn't exist."); url = f.toURI().toURL(); } else { url = ClassUtil.getResource(fileName, this.getClass()); } if (url==null){ log.info(fileName + " as a class path resource doesn't exist."); throw new WSDLException("null input", fileName); } URI uri = url.toURI(); WSDLLocator locator = new WSDLLocatorImpl(uri); wsdlDefinition = reader.readWSDL(locator); } catch (URISyntaxException e) { log.error(e.getMessage(), e); } catch (MalformedURLException ex) { log.error(ex.getMessage(), ex); } return wsdlDefinition; }
ReadWSDL { public Definition readWSDL(String fileName) throws WSDLException { Definition wsdlDefinition = null; WSDLFactory factory = WSDLFactoryImpl.newInstance(); WSDLReader reader = factory.newWSDLReader(); try { File f = new File(fileName); URL url = null; if (f.exists()) { log.info(fileName + " as a local file doesn't exist."); url = f.toURI().toURL(); } else { url = ClassUtil.getResource(fileName, this.getClass()); } if (url==null){ log.info(fileName + " as a class path resource doesn't exist."); throw new WSDLException("null input", fileName); } URI uri = url.toURI(); WSDLLocator locator = new WSDLLocatorImpl(uri); wsdlDefinition = reader.readWSDL(locator); } catch (URISyntaxException e) { log.error(e.getMessage(), e); } catch (MalformedURLException ex) { log.error(ex.getMessage(), ex); } return wsdlDefinition; } }
ReadWSDL { public Definition readWSDL(String fileName) throws WSDLException { Definition wsdlDefinition = null; WSDLFactory factory = WSDLFactoryImpl.newInstance(); WSDLReader reader = factory.newWSDLReader(); try { File f = new File(fileName); URL url = null; if (f.exists()) { log.info(fileName + " as a local file doesn't exist."); url = f.toURI().toURL(); } else { url = ClassUtil.getResource(fileName, this.getClass()); } if (url==null){ log.info(fileName + " as a class path resource doesn't exist."); throw new WSDLException("null input", fileName); } URI uri = url.toURI(); WSDLLocator locator = new WSDLLocatorImpl(uri); wsdlDefinition = reader.readWSDL(locator); } catch (URISyntaxException e) { log.error(e.getMessage(), e); } catch (MalformedURLException ex) { log.error(ex.getMessage(), ex); } return wsdlDefinition; }  }
ReadWSDL { public Definition readWSDL(String fileName) throws WSDLException { Definition wsdlDefinition = null; WSDLFactory factory = WSDLFactoryImpl.newInstance(); WSDLReader reader = factory.newWSDLReader(); try { File f = new File(fileName); URL url = null; if (f.exists()) { log.info(fileName + " as a local file doesn't exist."); url = f.toURI().toURL(); } else { url = ClassUtil.getResource(fileName, this.getClass()); } if (url==null){ log.info(fileName + " as a class path resource doesn't exist."); throw new WSDLException("null input", fileName); } URI uri = url.toURI(); WSDLLocator locator = new WSDLLocatorImpl(uri); wsdlDefinition = reader.readWSDL(locator); } catch (URISyntaxException e) { log.error(e.getMessage(), e); } catch (MalformedURLException ex) { log.error(ex.getMessage(), ex); } return wsdlDefinition; }  Definition readWSDL(String fileName); Definition readWSDL(URL wsdlUrl, String username, String password); Definition readWSDL(URL wsdlUrl); boolean isIgnoreSSLErrors(); void setIgnoreSSLErrors(boolean IgnoreSSLErrors); }
ReadWSDL { public Definition readWSDL(String fileName) throws WSDLException { Definition wsdlDefinition = null; WSDLFactory factory = WSDLFactoryImpl.newInstance(); WSDLReader reader = factory.newWSDLReader(); try { File f = new File(fileName); URL url = null; if (f.exists()) { log.info(fileName + " as a local file doesn't exist."); url = f.toURI().toURL(); } else { url = ClassUtil.getResource(fileName, this.getClass()); } if (url==null){ log.info(fileName + " as a class path resource doesn't exist."); throw new WSDLException("null input", fileName); } URI uri = url.toURI(); WSDLLocator locator = new WSDLLocatorImpl(uri); wsdlDefinition = reader.readWSDL(locator); } catch (URISyntaxException e) { log.error(e.getMessage(), e); } catch (MalformedURLException ex) { log.error(ex.getMessage(), ex); } return wsdlDefinition; }  Definition readWSDL(String fileName); Definition readWSDL(URL wsdlUrl, String username, String password); Definition readWSDL(URL wsdlUrl); boolean isIgnoreSSLErrors(); void setIgnoreSSLErrors(boolean IgnoreSSLErrors);  }