unable to read OAI XML from url with java FileUtils.getContents

132 Views Asked by At

I am trying to read a OAI xml from a web content with the following command (using java spring):

String xmlResponse = FileUtils.getContents(url, "UTF-8");

When setting the url to:

http://e-sdeir.uqac.ca/cgi/oai2-primo?verb=ListIdentifiers&metadataPrefix=oai_dc

The parameter: xmlResponse is NULL.

When setting the url to:

http://ub-madoc.bib.uni-mannheim.de/cgi/oai2?verb=ListIdentifiers&metadataPrefix=oai_dc

The parameter: xmlResponse contain the requested XML content from a web page.

Note that there are many other urls that resolve with NULL.

(If i not mistake it works in other place in the code - should I reset any parameter?).

Anyone know what may be the problem?

Thanks in advance, Mike

1

There are 1 best solutions below

0
On

The problem was indeed with the timeout. I increased the timeout and it works as expected.

Thanks any way!