Tag: google contacts

Google联系人gdata(Java)在内容类型无解析器时失败:application-xml

最近,2天前,当我们尝试访问联系人时,我们开始在Java中使用google gdata客户端遇到exception(feed:/ m8 / feeds / contacts / default / full)。 例外是: com.google.gdata.util.ParseException: No parser for content type:application-xml[application/xml] at com.google.gdata.client.Service.parseResponseData(Service.java:2142) at com.google.gdata.client.Service.parseResponseData(Service.java:2098) at com.google.gdata.client.Service.getFeed(Service.java:1136) at com.google.gdata.client.Service.getFeed(Service.java:1077) at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:676) at com.google.gdata.client.Service.getFeed(Service.java:1034) 有人嘲笑Wireshark并在谷歌文档中我看到正确的响应应该附带内容类型:application / atom + xml但谷歌的响应失败现在带有内容类型:application / xml。 似乎谷歌发生了一些变化,现在回归不正确的内容类型,我们的代码停止工作(它工作好几年)。 需要说谷歌应用程序租户(我们的客户)的一部分仍然工作正常(使用相同的代码),但客户的某些部分失败。 该问题是否有可能的解决方法? 谢谢

Google API v3检索所有联系人

我正在编写一个代码(用Java),让我可以使用谷歌API v3从我的谷歌帐户获取所有联系人。 我的问题是,在我成功授权访问帐户后,我只从“最常联系”组中获取联系人。 作为feedURL,我根据本教程使用https://www.google.com/m8/feeds/contacts/default/full/ 。 基本上我的代码是这个例子的复制粘贴,所以如何获得我的所有联系人?

在google.Internal服务器错误中添加联系人时出现exception

从java开始通过Google API插入联系人时,我们从今天早上开始收到以下错误。 请在下面找到堆栈跟踪 Exception while adding contact in google…. com.google.gdata.util.ServiceException: Internal Server Error A temporary internal problem has occurred. Try again later. at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:624) at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563) at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:552) at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530) at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535) at com.google.gdata.client.Service.insert(Service.java:1409) at com.google.gdata.client.GoogleService.insert(GoogleService.java:599) 我们在插入行时遇到此错误 ContactsService.insert(postUrl, contact) 如果有人知道解决方案,请回复。

从Oauth2 Google Contacts API获取Userinfo

我得到的错误: com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized { “code” : 401, “errors” : [ { “domain” : “global”, “location” : “Authorization”, “locationType” : “header”, “message” : “Invalid Credentials”, “reason” : “authError” } ], “message” : “Invalid Credentials” } 下面的代码,我正在使用: GoogleCredential credential = new GoogleCredential.Builder() .setTransport(this.TRANSPORT).setJsonFactory(this.JSON_FACTORY) .setClientSecrets(Constants.CLIENT_ID, Constants.CLIENT_SECRET).build(); credential.setAccessToken(tokenResponse.getAccessToken()); credential.setAccessToken(tokenResponse.getRefreshToken()); 到这里,我得到刷新令牌,访问令牌等 Oauth2 userInfoService = new Oauth2.Builder(this.TRANSPORT, this.JSON_FACTORY, credential.getRequestInitializer()) .setApplicationName(Constants.APPLICATION_NAME).build(); […]

使用java gwt生成内联图像

我正在尝试使用Java GWT编写内联映像。 但是图像不显示: 我联系到我的原因是,我用base64编写错误的方法,或者字符集是错误的。 因为在返回我在网上找到的以下pic代码时,一切正常(所以不是,我的浏览器无法显示内嵌图像): 这是我如何生成我的图片代码。 我打开一个url并尝试对结果进行base64编码: try { IoProvider.get().makeRequestAsText(url, new ResponseReceivedHandler() { public void onResponseReceived(ResponseReceivedEvent event) { final Response response = event.getResponse(); if (response.getStatusCode() == HTTP_OK){ callback.onSuccess(“data:unknown;base64,” + Base64.encode(response.getText())); } } }, options); } catch … 那就是我使用的base64编码器: http : //snipt.net/tweakt/gwt-base64/ 任何想法,为什么生成的图像无效? 编辑: 我根据你的答案重写了我的代码。 现在看来是这样的: IoProvider.get().makeRequest(url, new ResponseReceivedHandler() { public void onResponseReceived(ResponseReceivedEvent event) { final […]

检索有关Google People API(Java)的联系人的信息

我在这里使用最近发布的Google的People API的示例。 我稍微扩展了一些示例,以显示有关联系人的其他信息,例如电子邮件地址和电话号码。 应该完成这项工作的代码如下所示。 public class PeopleQuickstart { … public static void getPersonInfo(Person person){ // Get names List names = person.getNames(); if(names != null && names.size() > 0) { for(Name personName: names) { System.out.println(“Name: ” + personName.getDisplayName()); } } // Get email addresses List emails = person.getEmailAddresses(); if(emails != null && emails.size() > 0) { […]