Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6002943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:03:00+00:00 2026-05-23T01:03:00+00:00

I’m running into a peculiar problem when accessing Google Calendar — sometimes it generates

  • 0

I’m running into a peculiar problem when accessing Google Calendar — sometimes it generates a ‘redirect exception’ but most of the times it works just fine.

I have no idea how to redirect the call, and from what I read after some searching it should be handled by Google’s API itself invisible for the calling function (but obviously isn’t.)

The code accesses the Google calendar, gets a list of all the secondary calendars and the number of events each calendar has.

API version 1.8.0.0 (http://code.google.com/p/google-gdata/downloads/list)

Error message:

        Execution resulted in a redirect from https://www.google.com/calendar/feeds/tlf1juohv473hh0jhm046do5g9@group.calendar.google.com/private/full?gsessionid=MGsId0ULhyO_DkKlGa9DHw
        at Google.GData.Client.GDataRequest.Execute()
        at Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
        at Google.GData.Client.GDataGAuthRequest.Execute()
        at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince, String etag, Int64& contentLength)
        at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince)
        at Google.GData.Client.Service.Query(FeedQuery feedQuery)
        at GoogleDataTool.CalendarActions.GetSecondaryCalendars(Boolean IncludeEventCount, List`1& calendarlist) in D:\GoogleDataTool\classes\CalendarActions.cs:line 65

        Response.Message: "Stream was not readable."
        at Google.GData.Client.GDataRequest.Execute()
        at Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
        at Google.GData.Client.GDataGAuthRequest.Execute()
        at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince, String etag, Int64& contentLength)
        at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince)
        at Google.GData.Client.Service.Query(FeedQuery feedQuery)
        at GoogleDataTool.CalendarActions.GetSecondaryCalendars(Boolean IncludeEventCount, List`1& calendarlist) in  D:\GoogleDataTool\classes\CalendarActions.cs:line 84
        at GoogleDataTool.Program.DoActions() in D:\GoogleDataTool\Program.cs:line 34
        at GoogleDataTool.Program.Main(String[] args) in D:\GoogleDataTool\Program.cs:line 14
        at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
        at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
        at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
        at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
        at System.Threading.ThreadHelper.ThreadStart()

Code (it just collects the calendars, titles and eventcount in a collection):

        public bool GetSecondaryCalendars(out List<CalendarData> calendarlist)
    {
        Console.WriteLine( "Starting calendarlist retrieval..." );

        calendarlist = new List<CalendarData>();

        CalendarService myService = new CalendarService( "Calendar-application" );
        myService.setUserCredentials( "MyAccount@google.com", "MyPassword" );

        CalendarQuery cQuery = new CalendarQuery();
        cQuery.Uri = new Uri( "https://www.google.com/calendar/feeds/default/allcalendars/full" );

        try
        {
            CalendarFeed cFeed = (CalendarFeed)myService.Query( cQuery );

            foreach (CalendarEntry entry in cFeed.Entries)
            {
                // We don't want the primary calendar; just the secondary ones
                if (!entry.Id.Uri.ToString().Contains( HttpUtility.UrlEncode( "MyAccount@google.com" ) ))
                {
                    String calendarid = entry.Id.Uri.ToString().Substring( entry.Id.Uri.ToString().LastIndexOf( "/" ) + 1 );
                    calendarlist.Add( new CalendarData()
                    {
                        Text = entry.Title.Text,
                        Id = calendarid
                    } );
                }

                // Grab each calendar to count the number of events it has (not pretty, but I wish I could just ask the cFeed entries...)
                foreach (CalendarData calendar in calendarlist)
                {
                    FeedQuery query = new FeedQuery();

                    // Create the query object:
                    query.Uri = new Uri( string.Format( "https://www.google.com/calendar/feeds/{0}/private/full", calendar.Id ) );

                    // Tell the service to query:
                    AtomFeed calFeed = myService.Query( query );
                    calendar.EventCount = calFeed.Entries.Count;
                }
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine( ex.Message );
            return false;
        }
        return true;
    }

    public class CalendarData
    {
        public string Id { get; set; }
        public string Text { get; set; }
        public int EventCount { get; set; }
    }

Any suggestions are more than welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:03:02+00:00Added an answer on May 23, 2026 at 1:03 am

    From my pov you are working over the Internet – thus you should plan to try everything at least twice before giving up 😉
    Thus I would do one retry and then raise an actual exception visible to the end user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I need to clean up various Word 'smart' characters in user input, including but
I want use html5's new tag to play a wav file (currently only supported
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.