我们在GAE服务器和GWT和Android客户端上安装了Restlet小应用程序。 Restlet为GWT客户端提供GWT序列化回复,向JSON客户端提供JSON。
本地和AppEngine生产服务器上的GWT序列化都可以。 b $ b
安卓(JSON)客户端与本地开发服务器通话时,一切正常。
Android正在生产AppEngine服务器获取JSON回复,但POST失败。日志中没有错误或警告。服务器上的函数被调用,但传递的参数为空。
这是违规代码:
@Post(json) public void createLocationJSON(Location location){// location永远为空 //用'location'做某事}解决方案
为了让大家知道:我设法让GAE + Restlet + JSON + GWT经过大量的捣鼓工作。这个过程非常混乱(让我想起为Win32编程的日子):我只是改变了设置,直到它开始工作。
我遇到的问题是:
我不打算使用Restlet,原因如下(提示作者):
从那时起我切换到泽西岛。
We have a small app with Restlet on the GAE server and GWT and Android clients. Restlet serves GWT-serialized replies to GWT clients and JSON to Android clients.
All is ok with GWT-serialization both locally and on AppEngine production servers.
All is ok with Android (JSON) clients talking to local dev server.
Android taking to production AppEngine server GETs JSON replies, but POST fails. There is no error or warning in logs. The function on server gets called but parameter passed is null.
This is the offending code:
@Post("json") public void createLocationJSON(Location location) { // location is always null // do something with 'location' }解决方案
Just to let everybody know: I managed to get GAE+Restlet+JSON+GWT working after much fiddling. The process was really chaotic (reminded me of days programing for the Win32): I was just changing settings until it started working.
The problem that I was having is:
I'm not going to use Restlet for the following reasons (hint to authors):
Since then I switched to Jersey.
更多推荐
Restlet将JSON发布到Appengine错误
发布评论