【发布时间】:2015-03-05 21:49:02
【问题描述】:
我的 AppEngine 项目使用 GAE URL 获取 API 从特定链接检索 XML 数据。我使用了来自here 的示例,只是它看起来像这样:
InputStream stream;
URLConnection connection = new URL(url).openConnection();
connection.setConnectTimeout(0);
connection.setReadTimeout(0);
stream = connection.getInputStream();
这需要超过 60 秒(API 允许的最大值),因此会导致 DeadlineExceededException。使用 TaskQueues 也不是here 提到的选项。
到目前为止,还有其他方法可以实现吗?
谢谢!
【问题讨论】:
-
如果请求时间超过 60 秒,问题可能出在您从中检索 xml 的服务器上
-
你能用例如curl,如 Tim 所说,排除或确认服务器问题?
-
嗨@Tim源服务器本身没有任何问题。这是链接:muc2014.communitymashup.net/x3/mashup
标签: java google-app-engine urlfetch