4 messages in com.googlegroups.bloggerdevRe: 500 error from the server
FromSent OnAttachments
Marcelo17 Aug 2006 10:34 
Marcelo17 Aug 2006 11:42 
Eric Case29 Aug 2006 13:49 
Jussi30 Aug 2006 17:25 
Subject:Re: 500 error from the server
From:Jussi (juss@google.com)
Date:08/30/2006 05:25:46 PM
List:com.googlegroups.bloggerdev

Marcelo wrote:

I'm trying to use the GData API to access the feeds from a blog, but I'm getting a 500 error from the server.

Info: 1) If I go directly to the URL http://www.blogger.com/feeds/[blogId]/posts/full on a web browser, I'm asked for Auth and it works fine. 2) Using the GData code works only for a site that I created on the Blogger Beta, but not to an old site from Blogger. (Is this correct?)

Hi Marcelo, Eric already pointed you to another thread that discusses the problem you were seeing (accept headers).

Regarding your point #2, I wanted to clarify that yes the GData library does work against both the old Blogger blogs as well as new Blogger Beta blogs. The feed URLs in both cases look like blogger.com/feeds/.../posts/full and are listed as <link> elements in your blog's <head>.

I hope this helps,

Jussi

Yes, GData feeds and the GData client are supported on Beta blogs (new or migrated) only. I ran tests involving date range queries on a Beta blog and am not seeing a 500 server error. When you say "old site from Blogger" you mean a blog that's still on www.blogger.com and has not been migrated?

Thanks

Jussi

The code is quite simple (C#) FeedQuery query = new FeedQuery(); query.Uri = new Uri("http://www.blogger.com/feeds/" + blogId + "/posts/full"); query.StartDate = new DateTime(2006, 1, 1); query.EndDate = DateTime.Now.AddDays(1); Service srv = new Service("blogger", "Test-Sampa"); NetworkCredential nc = new NetworkCredential(userName, password); srv.Credentials = nc; AtomFeed feed = srv.Query(query); Console.WriteLine(feed.Title.Text);

Notice that the BlogId, userName and password are correct since I can validate them accessing it directly on the browser.

The error that I get is this: Unhandled Exception: Google.GData.Client.GDataRequestException: Execution of request failed: http://www.blogger.com/feeds/[blog id removed]/posts/full?updated-min=2006-01-01T00:00:00-08:00&updated-max=2006-08-18T10:24:39-07:00 ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at Google.GData.Client.GDataRequest.Execute() in D:\Google\clients\cs\src\core\request.cs:line 292 --- End of inner exception stack trace --- at Google.GData.Client.GDataGAuthRequest.Execute() in D:\Google\clients\cs\src\core\gauthrequest.cs:line 467 at Google.GData.Client.Service.Query(Uri queryUri) in D:\Google\clients\cs\src\core\service.cs:line 131 at Google.GData.Client.Service.Query(FeedQuery feedQuery) in D:\Google\clients\cs\src\core\service.cs:line 170 at TestCSharp2.Program.Main(String[] args) in C:\Documents and Settings\Marcelo\My Documents\Visual Studio 2005\Projects\TestCSharp2\TestCSharp2\Program.cs:line 58

I'm using .NET Framework 2.0.