Hello All!
I am getting this error while trying to Parse the Xml response from the Web Service by SAX Parser in Android.
ERROR in LogCat :- " Response =====> org.xml.sax.InputSource@43b8e230 "
I got to know that I need to convert the response in String may be by toString() Method, but the problem is I don't know how to do that as I had tried all the possible ways I knew for conversion but nothing happened.
In InputSource I am passing the url:-
URL url = new URL("http://www.google.com/ig/api?weather=Ahmedabad");
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xmlr = sp.getXMLReader();
DemoHandler myDemoHandler = new DemoHandler();
xmlr.setContentHandler(myDemoHandler);
xmlr.parse(new InputSource(url.openStream()));
Log.e(TAG, "Condition");
System.out.println("Response ====> " + new InputSource(url.openStream().toString()));
ParsedDemoData parsedDemoData = myDemoHandler.getParsedData();
Everything is fine but the response I am getting needs to be converted into String which I don't know how to do.
Can anyone please help in this.
Thanks, david