Open GoogleCodeExporter opened 9 years ago
the update error
[WebException: Remote server returned an error: (400) Bad Request.]
System.Net.HttpWebRequest.GetResponse() +5314029
Google.GData.Client.GDataRequest.Execute() +77
[GDataRequestException: Execution of request failed:
https://www.google.com/webmasters/tools/feeds/sites/http://www.example.com/]
Google.GData.Client.GDataRequest.Execute() +162
Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter) +402
Google.GData.Client.GDataGAuthRequest.Execute() +10
Google.GData.Client.Service.EntrySend(Uri feedUri, AtomBase baseEntry,
GDataRequestType type, AsyncSendData data) +190
Google.GData.Client.Service.Update(AtomEntry entry, AsyncSendData data) +79
Google.GData.Client.Service.Update(TEntry entry) +46
Original comment by wingo...@gmail.com
on 1 May 2010 at 7:18
i find it's my error, the update fail is because the site is not
verified,sorry( ̄▽ ̄")
Original comment by wingo...@gmail.com
on 1 May 2010 at 4:48
after 2 days working on this( ̄▽ ̄"), i find this error is beacuse the url
which
post/put to google is not correct. these raw url are all has the urlencode
siteid
like http%3A%2F%2Fwww%2Eexample%2Ecom%2F,,but the .net uri.AbsoluteUri has a
bug and
it will convert %2f to slash(/),so the url is error,microsoft says will fix
this
in .net 4.0,i don't test in this verision.
in the method UpdateSiteEntry in WebmasterToolsRequest, i find a method
CreateCustomUri which says to fix this bug, and with debug i find the last url
to
post to google is like this : http%253A%252F%252Fwww.example.com%252F , and
google
accept it,,but when i try to add a sitemap using AddSitemap in
WebmasterToolsRequest
, it also call the method CreateCustomUri but google don't accept it, so what
can i
do? just wait microsoft to fix or?
Original comment by wingo...@gmail.com
on 3 May 2010 at 4:52
we are working on this. If you use the request model it will actually
successfully post to the correct URL, but
there is problem with one element that is not persisted correctly yet...
Original comment by fman...@gmail.com
on 5 May 2010 at 8:41
yes, i have update PreferredDomain successfully using the request model, but
now i can't
insert a sitemap to a site, the error catched by GDataRequestException is
"Invalid request
URI", and i found a extension method workarounds to fixed .net uri error in
here:
http://connect.microsoft.com/VisualStudio/feedback/details/94109/system-uri-cons
tructor-
evaluates-escaped-slashes-and-removes-double-slashes
it really works, after fixed this there is another error returned "Missing
entry type", and
my method insert sitemap is :
var entry = new SitemapsEntry();
entry.Id = new AtomId(fullDomainUrl + "sitemap.xml");
entry.Categories.Add(new
AtomCategory("http://schemas.google.com/webmasters/tools/2007#site-info", new
AtomUri("http://schemas.google.com/g/2005#kind")));
entry.SitemapType = "WEB";
//myService.Insert(new Uri(SitemapsQuery.HttpsFeedUrl), entry);
try
{
Uri uro3 = new
Uri(string.Format("https://www.google.com/webmasters/tools/feeds/{0}/sitemaps/",
HttpUtility.UrlEncode(fullDomainUrl)));
uro3.LeaveDotsAndSlashesEscaped();
//myService.EntrySend(uro3, entry, GDataRequestType.Insert);
myService.Insert(uro3, entry);
}
catch (GDataRequestException e)
{
Response.Write(e.ResponseString);
//throw;
}
and also i use the request model, it return the same error, is there any
solution to insert
sitemap?
Original comment by wingo...@gmail.com
on 5 May 2010 at 8:58
Original comment by ccherub...@google.com
on 29 Mar 2011 at 10:19
Original issue reported on code.google.com by
wingo...@gmail.com
on 1 May 2010 at 7:13