【发布时间】:2014-02-13 13:02:04
【问题描述】:
我使用镜像 api 开发了一个谷歌玻璃应用程序。在开发过程中,我使用 "Introspected tunnels to localhost" 来接收通知。
现在我在生产服务器上上传了我的应用程序。所以现在我将我的回调 URL 配置为我的域名,例如 https://www.mydomain.com:8443/notify。但我收到空通知。
在通知 servlet 中:
BufferedReader notificationReader = new BufferedReader(
new InputStreamReader(request.getInputStream()));
String notificationString = "";
int lines = 0;
while (notificationReader.ready()) {
notificationString += notificationReader.readLine();
lines++;
if (lines > 1000) {
throw new IOException(
"Attempted to parse notification payload that was unexpectedly long.");
}
}
LOG.info("\ngot raw notification : " + notificationString);
在 catalina.out 中
Feb 13, 2014 12:51:48 PM com.google.glassware.NotifyServlet doPost
INFO: got raw notification :
我该如何解决?
【问题讨论】:
-
听起来你有一个需要隔离的小鬼。如果您使用 curl 将某些内容发布到通知端点会发生什么?您发布的内容是否会出现在您的日志中?
-
是的,这是我的日志,它是空的。不,我还没有使用 curl。我应该隔离哪一部分?
-
Rudy - 我认为 Jenny 建议您使用 curl 来模拟您希望从客户端应用程序获得的通知。这有意义吗?
-
是的,我正在努力。
-
你的网站通知地址和调用示例是什么?
标签: java google-glass google-mirror-api