views:

14

answers:

1
var settings = new RequestSettings("appname", "googleusername", "googlepassword");
var service = new WebmasterToolsRequest(settings);
var site = new Sites("http://www.mysite.com", "text/plain");
Sites resultSite = service.AddSite(site);
resultSite.VerificationMethod.Type = "htmlpage";
resultSite.SitesEntry.Update();

.Update fails with a 400 (Bad Request).

Any ideas what I'm doing wrong?

ps. It almost seems easier to just code to the raw google api, this particular library seems to be like vb6, easy to do the easy things, hard to impossible to the do the medium to hard things...

A: 

Ok, I'm getting a bit further here.

I've tried this which follows a sample for updating the GeoLocation:

var settings = new RequestSettings("appname", "googleusername", "googlepassword");
var service = new WebmasterToolsRequest(settings);
var site = new Sites("http://www.mysite.com", "text/plain");
Sites resultSite = service.AddSite(site);
resultSite.VerificationMethod.Type = "htmlpage";
resultSite.VerificationMethod.InUse = "true";
var resultSite = service.UpdateSiteEntry(resultSite, siteUrl);

I'm still getting a 400 (Bad Request). ResponseStream is:

"[Line 7, Column 247, element wt:verification-method] Unknown attribute: 'value' "

Monti
I've moved on and tried posting directly to the Google Data apis without success. I now get an Invalid Request URI...(and yes, the uri matches exactly the one in the specification)
Monti