私は Eclipse を使用して Android クライアントを構築し、GAE と GWT を使用して開発した restlet サービスを再利用しています。
私のサービスはで実行されています
http://127.0.0.1:8888/abc/audits
この URL に直接アクセスし、GWT クライアントを使用してこれをテストできます。どちらも機能します。
ただし、次のコードは通信エラーを返します。
private AuditsResource resource;
private Audits audits;
ClientResource cr = new ClientResource("http://127.0.0.1:8888/abc/audits");
resource = cr.wrap(AuditsResource.class);
try {
// Get the remote contact
audits = resource.retrieve();
// The task is over, let the parent conclude.
handler.sendEmptyMessage(0);
} catch (Exception e) {
Message msg = Message.obtain(handler, 2);
Bundle data = new Bundle();
data.putString("msg", "Cannot get the contact due to: "
+ e.getMessage());
msg.setData(data);
handler.sendMessage(msg);
}
次にどこを見たらいいのかわからない。AuditsResource のサーバー実装を計測しましたが、(Android アプリケーションによって) 触れられることはありません。
AuditsResource クラスにはメソッドが 1 つあります。
@Get
public Audits retrieve();