0

我是使用 REST 框架的 android 新手,并且正在连接到 GAE 服务器。使用 datastore objectify 将数据从 android 存储到 GAE 任何人都可以帮我解决这个错误吗?

11-29 14:23:13.421: I/ApplicationPackageManager(13615): cscCountry is not German : XTC
11-29 14:23:23.609: I/ApplicationPackageManager(13615): cscCountry is not German : XTC
11-29 14:23:27.273: D/dalvikvm(13615): GC_CONCURRENT freed 220K, 48% free 2987K/5639K, external 508K/517K, paused 4ms+4ms
11-29 14:23:38.609: D/dalvikvm(13615): GC_CONCURRENT freed 316K, 47% free 3176K/5895K, external 508K/517K, paused 3ms+5ms
11-29 14:23:38.773: D/dalvikvm(13615): GC_CONCURRENT freed 227K, 45% free 3408K/6087K, external 508K/517K, paused 3ms+3ms
11-29 14:23:38.968: D/dalvikvm(13615): GC_CONCURRENT freed 261K, 42% free 3698K/6343K, external 508K/517K, paused 3ms+8ms
11-29 14:23:39.187: D/dalvikvm(13615): GC_CONCURRENT freed 265K, 41% free 3950K/6599K, external 508K/517K, paused 4ms+5ms
11-29 14:23:39.203: I/org.restlet(13615): Starting the default HTTP client
11-29 14:23:50.695: I/global(13615): Loaded time zone names for en_US in 628ms.
11-29 14:23:50.703: I/PortalUserController(13615): Creation failed !
11-29 14:23:50.703: I/(13615): Method Not Allowed
11-29 14:23:50.703: I/System.out(13615): Method Not Allowed

//这里是整个类

公共类 PortalUserController {

 public final ClientResource cr = new ClientResource(
         ServerConfiguration.gae_path + "/rest/user");

         public PortalUserController() {
             ServerConfiguration.getInstance();
         }

         public void create(PortalUser user) throws Exception {
         final PortalUserControllerInterface uci = cr.wrap(PortalUserControllerInterface.class);

         try {
         uci.create(user);

         Log.i("PoralUserController", "Creation success !");
         } catch (Exception e) {
         Log.i("PortalUserController", "Creation failed !");
         Log.i("", e.getMessage());
         System.out.println(e.getMessage());
         throw e;
         }
         }

         public List<PortalUser>getAllUsers() {
         final PortalUserControllerInterface uci = cr
         .wrap(PortalUserControllerInterface.class);
         DataContainer content = uci.getAllUsers();
         return content.getUser_list();
         }

}

提前感谢。

4

1 回答 1

0
"Method Not Allowed"

您使用了错误的方法,即:您可能正在发送 GET,而服务器仅接受给定 URL 上的 POST;

于 2012-11-29T09:50:09.593 回答