1

(google-api-java-clientサイトで説明されているように)手動でxmlモデルを作成して、Googleの連絡先に連絡先を追加しようとしていますが、連絡先をPOSTしようとすると、常に400の不正なリクエストが発生します。私のモデルとさまざまな可能性を試してみてくださいが、うまくいきません。名前と電話番号の連絡先を追加する単一のxmlモデルを作成できる人はいますか?これは私のContactEntryモデルです:

public class ContactEntry
{
@Key
public Category category;

@Key("gd:name")
public Name name;

@Key
public String id;


@Key
public String title;

@Key
public Content content;

@Key("gd:phoneNumber")
public PhoneNumber phoneNumber;

}

カテゴリクラス:

public class Category
{
@Key("@scheme")
public String scheme;

@Key("@term")
public String term;

public Category()
{
    this.scheme = "http://schemas.google.com/g/2005#kind";
    this.term = "http://schemas.google.com/contact/2008#contact";
}

}

名前クラス:

public class Name
{
@Key("@gd:givenName")
public String givenName;

@Key("@gd:familyName")
public String familyName;

@Key("@rel")
public String rel;

@Key("@fullName")
public String fullName;

public Name()
{
}

public Name(String givenName,String familyName)
{
    this.givenName = givenName;
    this.familyName = familyName;
    this.rel = "http://schemas.google.com/g/2005#other";//this is for test             
    this.fullName = givenName + familyName;
}

}

4

0 に答える 0