Contacts API v3、グループ クエリ パラメータは「q」パラメータをサポートしていませんか??? Google Contacts API v3 では、サポートされていることが明確に示されています。しかし、Google が提供する Java クライアント ライブラリを使用して、クエリで setFullTextQuery によってコントラクト グループを検索すると、HTTP ステータス 403 Forbidden が返されます。「スレッド「メイン」com.google.gdata.util.ServiceForbiddenException の例外: Forbidden このサービスは「q」パラメーターをサポートしていません」をスローします。
最新の Java クライアント ライブラリをダウンロードしました: GDATA 用の GData-Java/1.47.1(gzip)。連絡先グループを検索するには、setFullTextQuery メソッドを使用してみてください。
問題を再現する手順は何ですか?
- Java サンプル連絡先の設定
- ContactsExample.java の queryEntries メソッドで、新しい行を追加します。myQuery.setFullTextQuery("ここに検索用語");
- そして、それを実行します
バージョンが正しいことを確認しました。GData-Version: 3.0 を使用しています。提供されているサンプル Java を実行すると、すべて正常に動作します。しかし、連絡先を検索する必要があります。そして、「q」パラメーターを使用するのが正しいアプローチです。
助けてください。ライブラリに問題があるのでしょうか、それとも別の方法で連絡先を検索する必要がありますか?
以下のログ:
実行アクション: QUERY
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest setPrivateHeader FINER: 承認:
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest setHeader FINER: ユーザー エージェント: Google-contactsExampleApp-3 GContacts-Java/3.1.0 GData-Java/1.47.1(gzip)
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest setHeader FINER: Accept-Encoding: gzip
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest setHeader FINER: GData-Version: 3.0
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest FINE を実行: 403 禁止
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest FINER を実行: null: HTTP/1.1 403 禁止
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest FINER を実行: X-Frame-Options: SAMEORIGIN
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest 実行 FINER: Transfer-Encoding: チャンク
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest 実行 FINER: 日付: 2012 年 11 月 28 日水曜日 17:38:48 GMT
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest 実行 FINER: 期限切れ: 2012 年 11 月 28 日水曜日 17:38:48 GMT
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest FINER を実行: X-XSS-Protection: 1; モード=ブロック
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest 実行 FINER: コンテンツ エンコーディング: gzip
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest FINER を実行: コンテンツ タイプ: テキスト/html; 文字セット=UTF-8
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest FINER を実行: サーバー: GSE
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest FINER を実行: キャッシュ コントロール: プライベート、最大年齢 = 0
2012 年 11 月 28 日 12:38:48 PM com.google.gdata.client.http.HttpGDataRequest FINER を実行: X-Content-Type-Options: nosniff
スレッド「メイン」の例外 com.google.gdata.util.ServiceForbiddenException: Forbidden このサービスは「q」パラメータをサポートしていません。
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:605)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
at com.google.gdata.client.Service.getFeed(Service.java:1135)
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.query(Service.java:1237)
at com.google.gdata.client.Service.query(Service.java:1178)
at sample.contacts.ContactsExample.queryEntries(ContactsExample.java:406)
at sample.contacts.ContactsExample.processAction(ContactsExample.java:350)
at sample.contacts.ContactsExample.main(ContactsExample.java:626)
Java 結果: 1