Hi All,
I have a problem when updating feed entry using ClientLogin and
Java. I am able to read and insert data in my account but have a
permanent problem with update.
Here is a code which throws "Bad Request: Your client has issued a
malformed or illegal request" exception. It basically reads Entry from
the feed and then tries to update feed with exactly the same entry,
nothing else.
String PROFILE_FEED_PATH_TEST = "https://www.google.com/h9/feeds/
profile/ui/";
String profileId = "XXXXXX";
H9Service service = new com.google.gdata.client.health.H9Service
("MyCompanyName");
String username = "YYYYYY";
String password = "ZZZZZZ";
try {
service.setUserCredentials(username, password);
Feed feed = service.getFeed(
new URL(PROFILE_FEED_PATH_TEST + profileId), Feed.class);
List<Entry> entries = new ArrayList<Entry>();
//entries are read successfully
for(Entry entry : feed.getEntries()) {
entries.add(entry);
}
Entry testEntry = entries.get(0);
String entryId = testEntry.getId();
String url = entryId;
//that is where exception is thrown
Entry updatedEntry = service.update(new URL(url), testEntry);
} catch(Exception ex) {
System.out.println("error updating Google");
}
What is wrong with this code? Is it versioning, wrong udate datetime
or something else?
If somebody has a working example of code making this kind of update,
post it please. It can be a great help for me.
Thanks in advance for your help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Health Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/googlehealthdevelopers?hl=en
-~----------~----~----~----~------~----~------~--~---