使用谷歌应用引擎检索所有用户

时间:2011-11-29 01:04:04

标签: java google-app-engine oauth gdata

我获得了oauth授权,也启用了api配置。还将所有数据源添加到我的项目中,并且仍然出现错误

      UserService client = new UserService("mdeocasec");
      try {
        client.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());

      } catch (OAuthException e) {
        e.printStackTrace();
      }

      URL url = null;
      try {
        url = new URL("https://apps-apis.google.com/a/feeds/user/");

      } catch (MalformedURLException e) {

        e.printStackTrace();
      }

      BaseFeed<UserFeed, UserEntry> userFeed = null;
      try {

       userFeed = client.getFeed(url, UserFeed.class);

      } catch (IOException e) {

        e.printStackTrace();
      } catch (ServiceException e) {
          System.out.println("l"+e.getMessage());
        e.printStackTrace();
      } 

   error here >>> List<UserEntry> userEntries = userFeed.getEntries(); 

0 个答案:

没有答案