Ebeo / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Inconsistent results when using .Net Google Calendar API #376

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using a simple test program to try the Google Calendar .Net API.

The code is posted below.

The program will create a new calendar and post a single event into the 
new calendar.

The problem is that the new calendar sometimes is "missing" some of its 
attributes, specifically its title and its time zone.  The calendar is 
always created, and the event is always entered.  Just jumbled name/title 
and time zone.  It does not always occur, probably 50% of the time.

In the sample code, I have commented-out a foreach block that enumerated 
the existing calendars before creating the new calendar.  With that code 
active, the program fails 75% of the time.  With the code commented-out, 
it fails 25% of the time.  

I have attached some screen shots showing the results after serveral runs 
of the test program.

Thanks.

Bryan Hunt

=====================================================================

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Google.GData.AccessControl;

using Google.GData.Calendar;

using Google.GData.Client;

using Google.GData.Extensions;

namespace GoogleCalendarTest1

{

    class Program

    {

        static void Main(string[] args)

        {

            string company = "XYZ";

            CalendarService myService = new CalendarService
("RHCCalendars");

            myService.setUserCredentials
("roppebiddingcalendar@gmail.com", "RBCPW.2010");

            CalendarQuery query = new CalendarQuery();

            query.Uri = new Uri
("http://www.google.com/calendar/feeds/default/owncalendars/full");

            CalendarFeed resultFeed = (CalendarFeed)myService.Query(query);

            Console.WriteLine("Your calendar count:  " + 
resultFeed.Entries.Count.ToString());

            //foreach (CalendarEntry myEntry in resultFeed.Entries)

            //{

            //    Console.WriteLine("Name: " +myEntry.Title.Text);

            //}

            CalendarEntry calendar = new CalendarEntry();

            calendar.Title.Text = company + " Bidding Calendar";

            calendar.Summary.Text = "This calendar contains upcoming " + 
company + " jobs for bid.";

            calendar.TimeZone = "(GMT-05:00) Eastern Time";

            calendar.Color = "#2952A3";

            calendar.Location = new Where("", "", "US & Canada");

            Uri postUri = new Uri
("http://www.google.com/calendar/feeds/default/owncalendars/full");

            CalendarEntry createdCalendar = (CalendarEntry)myService.Insert
(postUri, calendar);

            Uri bidCalendarUri = new Uri
(createdCalendar.Content.AbsoluteUri);

            EventEntry entry = new EventEntry();

            // Set the title and content of the entry.

            entry.Title.Text = "Long work day";

            entry.Content.Content = "No rest for the weary...";

            // Set a location for the event.

            Where eventLocation = new Where();

            eventLocation.ValueString = "Ohio";

            entry.Locations.Add(eventLocation);

            When eventTime = new When(new DateTime(2010, 4, 23, 8, 0, 0), 
new DateTime(2010, 4, 23, 17, 0, 0));

            entry.Times.Add(eventTime);

            // Send the request and receive the response:

            AtomEntry insertedEntry = myService.Insert(bidCalendarUri, 
entry);

        }

    }

}

Original issue reported on code.google.com by RoppeBid...@gmail.com on 23 Apr 2010 at 3:26

Attachments:

GoogleCodeExporter commented 9 years ago
Wow.  This may not be an API issue at all.

I decided to create the calendars manually from the Google web page.

Two of the three pages that I added manually dropped the title and time zone 
fields 
that I entered.  I could edit the calendars and correct them, but that add 
process 
did not work properly, just like the API.

Is there some sort of systemic issue going on with the whole Google calendar 
system?

Thanks.

Bryan Hunt

Original comment by RoppeBid...@gmail.com on 23 Apr 2010 at 9:34

GoogleCodeExporter commented 9 years ago
I can't tell you if there was / is any systemic issue going on with Calendar 
right
now (I am not part of the Calendar team). What you are describing is sure not a 
.NET
client library issue, but if it is still happening a calendar issue. I will 
close
this issue and let someone inside know about it.

Original comment by fman...@gmail.com on 26 Apr 2010 at 1:55

GoogleCodeExporter commented 9 years ago
Thanks Frank.

After the issue with the manual creation of calendars, I would agree, not a 
.net api 
issue.  It is behaving exactly as the manual calendar creation.

Original comment by RoppeBid...@gmail.com on 27 Apr 2010 at 12:43

GoogleCodeExporter commented 9 years ago
Frank,

If you are alerting someone on that calendar team about this, please point them 
to: 
http://www.google.com/support/forum/p/Calendar/thread?
tid=119bf7ad8e5ffb6f&hl=en&fid=119bf7ad8e5ffb6f000485385c585e6b

This thread shows that there are quite a few people experiencing this issue.

Thanks.

Bryan Hunt

Original comment by RoppeBid...@gmail.com on 27 Apr 2010 at 2:06