title: How to read wsdl from a url using java
body: <p>I'm new to java. I want to read wsdl from java. I have sample northwind service <a href="http://services.odata.org/Northwind/Northwind.svc/" rel="nofollow">http://services.odata.org/Northwind/Northwind.svc/</a>$metadata</p>
  
  <p>I want to read output xml for the above URL. I tried in different ways, It didn't work.</p>
  
  <pre><code>    URL oracle = new URL("http://services.odata.org/Northwind/Northwind.svc/$metadata");
      BufferedReader in = new BufferedReader(
      new InputStreamReader(oracle.openStream()));
  
      String inputLine;
      while ((inputLine = in.readLine()) != null)
          System.out.println(inputLine);
      in.close();
  </code></pre>
  
  <p>Method #2</p>
  
  <pre><code>private static void readHttp() {
      Charset charset = Charset.forName("US-ASCII");
      Path file = Paths.get("http://services.odata.org/Northwind/Northwind.svc/$metadata");
      try (BufferedReader reader = Files.newBufferedReader(file, charset)) {
          String line = null;
          while ((line = reader.readLine()) != null) {
              System.out.println(line);
          }
      } catch (IOException x) {
          System.err.format("IOException: %s%n", x);
      }
  }
  </code></pre>
  
  <p>Can anyone suggest me how to proceed on this.</p>
  
  <p>Thanks,</p>