开发者

GAEJ: loading external XML

开发者 https://www.devze.com 2023-02-09 11:16 出处:网络
What is开发者_Python百科 the simpliest way to load an external xml within Google App Engine framework?

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();
0

精彩评论

暂无评论...
验证码 换一张
取 消