GAEJ: loading external XML
What is开发者_Python百科 the simpliest way to load an external xml within Google App Engine framework?
I tried what Google advises:
URL url = new URL("http://mydomain.com/data.xml");
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while ((line = reader.readLine()) != null) {
// ...
}
reader.close();
But it doesn't work.
it gives line = null
To be able to get items from other web sites you are going to need the URLFetch service.
Have you tried getting the page in a browser ? Have you tried a sample standalone program ? You also do not specify if you are working in debug mode or on GAE server. Are you behind a firewall ?
Thanks everyone for help. It was an inappropriate panic by me caused by my noobnes in Java. It was handled this way. Sorry for disturing.
while ((line = reader.readLine()) != null)
{
xmlResponce = xmlResponce.concat(line);
}
reader.close();
精彩评论