Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Calendar API Error 405
    text
    copied!<p>I was trying out the Google Calendar API from <a href="http://www.codeproject.com/Articles/196548/Managing-Google-Calendar-Events-using-NET" rel="nofollow">this sample code</a> but I am getting the following error:</p> <pre><code>Execution of authentication request returned unexpected result: 405 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Google.GData.Client.GDataRequestException: Execution of authentication request returned unexpected result: 405 </code></pre> <p>Stack Trace:</p> <p>Stack Trace: </p> <blockquote> <p>[GDataRequestException: Execution of authentication request returned unexpected result: 405]<br> _2.BusinessLogicLayer.LogicClasses.LeaveLogic.AddToGoogleCalendar() in C:\Users\Samsung\Desktop\Development\Ticketing system\2.BusinessLogicLayer\LogicClasses\LeaveLogic.cs:375<br> _1.PresentationLayer.WebPages.LeaveRequest.tstbtn_Click(Object sender, EventArgs e) in C:\Users\Samsung\Desktop\Development\Ticketing system\1.PresentationLayer\WebPages\LeaveRequest.aspx.cs:403<br> System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9553594<br> System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103<br> System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10<br> System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13<br> System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724</p> </blockquote> <p>Code:</p> <pre><code>string sGoogleUserName = "******@gmail.com"; string sGooglePassword = "*****"; Uri oCalendarUri = new Uri("http://www.google.com/calendar/feeds/" + sGoogleUserName + "/private/full"); //Initialize Calendar Service CalendarService oCalendarService = new CalendarService("CalendarSampleApp"); oCalendarService.setUserCredentials(sGoogleUserName, sGooglePassword); //Use Proxy GDataRequestFactory oRequestFactory = (GDataRequestFactory)oCalendarService.RequestFactory; WebProxy oWebProxy = new WebProxy(WebRequest.DefaultWebProxy.GetProxy(oCalendarUri)); oWebProxy.Credentials = CredentialCache.DefaultCredentials; oWebProxy.UseDefaultCredentials = true; oRequestFactory.Proxy = oWebProxy; //Set Event Entry EventEntry oEventEntry = new EventEntry(); oEventEntry.Title.Text = "Test Calendar Entry From .Net"; oEventEntry.Content.Content = "Hurrah!!! I posted my first Google calendar event through .Net"; //Set Event Location Where oEventLocation = new Where(); oEventLocation.ValueString = "New Zealand"; oEventEntry.Locations.Add(oEventLocation); //Set Event Time When oEventTime = new When(new DateTime(2011, 5, 31, 9, 0, 0), new DateTime(2011, 5, 31, 9, 0, 0).AddHours(1)); oEventEntry.Times.Add(oEventTime); //Set Additional Properties ExtendedProperty oExtendedProperty = new ExtendedProperty(); oExtendedProperty.Name = "SynchronizationID"; oExtendedProperty.Value = Guid.NewGuid().ToString(); oEventEntry.ExtensionElements.Add(oExtendedProperty); // CalendarService oCalendarService = GAuthenticate(); //Prevents This Error //{"The remote server returned an error: (417) Expectation failed."} System.Net.ServicePointManager.Expect100Continue = false; //Save Event oCalendarService.Insert(oCalendarUri, oEventEntry); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload