title: MalformedURLException when parsing web service response
body: <p>So I am trying to write a simple web service that gets the current weather. With the following code the web service method can be called and the returned XML data can be printed to the console.</p>
  
  <p>However, when I try to parse this method response I get MalformedURLException. I can see the XML I want to parse in the error. </p>
  
  <p>So I tried saving the response to a file to parse it that way:</p>
  
  <p>When I try saving the web response to a file I get all Chinese letters. <code>System.out.println</code> prints out the XML perfectly to the console like I need it to be in the file.</p>
  
  <p>I am a total newb so please excuse me if I am missing something very simple. I would like to do this without having to save the file locally, but whatever works is good here.</p>
  
  <p>My problem lies somewhere in this code:</p>
  
  <pre><code>GlobalWeather service = new GlobalWeather();  
  GlobalWeatherSoap port = service.getGlobalWeatherSoap();
  String data = port.getWeather(city, country);
  
  // this prints the xml response to the console perfectly
  System.out.println(data);
  
  SAXParserFactory spf = SAXParserFactory.newInstance();
  spf.setNamespaceAware(true);
  SAXParser saxParser = spf.newSAXParser();
  XMLReader xmlReader = saxParser.getXMLReader();
  xmlReader.setContentHandler(new WeatherApp());
  
  // this gives MalformedURLexception when set up this way.
  // this gives the correct output when passed a locally stored XML file
  // I have omitted my SAX methods and my weather class that holds the data
  // but all work fine when using a local XML file on my machine.
  xmlReader.parse(data);
  </code></pre>