momijigari
momijigari

Reputation: 1598

GAEJ: loading external XML

What is 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

Upvotes: 0

Views: 210

Answers (2)

momijigari
momijigari

Reputation: 1598

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

Upvotes: 0

Romain Hippeau
Romain Hippeau

Reputation: 24375

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 ?

Upvotes: 3

Related Questions