Hi Ryan,
Thanks for the reply, unfortunately I was not able to use the snipped
that you included as those two are not available in the binaries, the
way I am doing is as follows, please note that the authCode I am
getting is from the accepting the Grant Access when googles prompts me
to access the calendar, so I think I was right upto that part, the
error that I was getting is 401 Unauthorized. Please let me know your
thoughts.

sub add event
authCode = authCode.Trim()
        Response.Write("<hr>" & authCode & "|")
        Dim URL As String = "http://www.google.com";
        Dim pageStr As String = "/calendar/feeds/default/private/full"

        Dim req As HttpWebRequest
        req = WebRequest.Create(URL & pageStr)
        req.Method = "POST"
        req.Headers.Add("Authorization", "GoogleLogin auth=" &
authCode)

        Dim anEntry As String = "<?xml version='1.0' ?>" & _
                                "<entry
xmlns='http://www.w3.org/2005/Atom'
xmlns:gd='http://schemas.google.com/g/2005'>" & _
                                "<category
scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/g/2005#event'></category>" & _
                                "<title type='text'>Testing!</title>" &
_
                                "<content type='xhtml'>" & _
                                "<div
xmlns='http://www.w3.org/1999/xhtml'>Yes, you can put XHTML<br/> into
the content!</div>" & _
                                "</content><author><name>Appa
Rao</name><email>[EMAIL PROTECTED]</email></author>" & _
                                "<gd:transparency
value='http://schemas.google.com/g/2005#event.transparent'></gd:transparency>"
& _
                                "<gd:eventStatus
value='http://schemas.google.com/g/2005#event.confirmed'></gd:eventStatus>"
& _
                                "<gd:where valueString='Duvvada,
India() '></gd:where>" & _
                                "<gd:when
startTime='2007-05-22T15:00:00.000Z'
endTime='2007-05-22T17:00:00.000Z'></gd:when>" & _
                                "</entry>"


        Dim post_string As String = anEntry '// We must supply the XML
calendar data on both this transaction and the following one.
        req.Timeout = 30000


        Dim lbPostBuffer() As Byte =
System.Text.Encoding.GetEncoding(1252).GetBytes(post_string)


        req.ContentType = "application/atom+xml"
        req.ContentLength = lbPostBuffer.Length
        Dim requestStream As Stream = req.GetRequestStream()
        requestStream.Write(lbPostBuffer, 0, lbPostBuffer.Length)
        requestStream.Close()

        ' req.SendChunked = True
        Dim resp As HttpWebResponse = req.GetResponse()


        Dim sr As New StreamReader(resp.GetResponseStream(),
System.Text.Encoding.GetEncoding("utf-8"))
        Dim respStr As String = sr.ReadToEnd()
        sr.Close()


        Response.Write("<hr>" & resp.StatusCode & "<br>")

end sub


On Jan 8, 10:17 pm, "Ryan Boyd (Google)" <[EMAIL PROTECTED]> wrote:
> BTW, please let me know if the code I pointed to provides a good
> starting point for you, or if you have any additional questions.
>
> Cheers,
>
> -Ryan
>
> On Jan 8, 9:11 am, "Ryan Boyd (Google)" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Murthy,
>
> > Yes, there is some example code in a post 
> > at:http://groups-beta.google.com/group/google-calendar-help-dataapi/brow...
>
> > We're in the process of getting together a more complete sample for the
> > website, but hopefully that should help you on your way.
>
> > Please note -- while I have tested and used AuthSub with a ASP.NET app
> > (in C#), I have not tested using the 'secure' method.  There are some
> > recent posts regarding problems working with the secure mode (where you
> > have registered a certificate with Google) with the .NET libraries.
> > I'm currently in the process of investigating these issues.
>
> > -Ryan
>
> > On Jan 8, 12:58 am, "Murthy" <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
> > > I have a question regarding calling the Calendar Service from a web
> > > application, I am building an ASP.NET app using VB.NET and trying to
> > > connect to the google service using "Account Authentication Proxy for
> > > Web-Based Applications", but I am not able to find any thing as all the
> > > examples show how to connect to the service using desktop client
> > > (winforms). Is it possible to connect to google service and retrieve or
> > > add or delete events from my calendar using ASP.NET and VB.NET or c# ?
> > > if so and if you have any piece of code that can help me it would be
> > > greatly appreciated. Please email me either a link or any code to
> > > [EMAIL PROTECTED]
>
> > > Regards
> > > Murthy
>
> > > On Jan 5, 4:52 pm, "Frank Mantek" <[EMAIL PROTECTED]> wrote:
>
> > > > The .NET client library has now a new home (currently in addition to 
> > > > the one
> > > > at code.google.com/gdata). The current 1.08 download and all future
> > > > downloads will be available at:
>
> > > >http://code.google.com/p/google-gdata/
>
> > > > following the download tab (or just use the featured download).
>
> > > > Also, tips etc will appear there on the wiki pages (currently the 
> > > > existing
> > > > tips are present).
>
> > > > Frank Mantek
>
> > > > On 12/7/06, Frank Mantek <[EMAIL PROTECTED]> wrote:
>
> > > > > This new version of the .NET library is the biggest single release 
> > > > > since
> > > > > the original one. It includes several fixes, support for Windows 
> > > > > Mobile and
> > > > > support for
> > > > > Google Spreadsheets.
>
> > > > > Right now, you can get it at:
>
> > > > >http://code.google.com/p/google-gdata/source
>
> > > > > via subversion.
>
> > > > > The binary download should be updated in the next few days.
>
> > > > > = 1.0.8 ==
> > > > > - Fixed issue 13 from the public issue list. If a content element
> > > > > contained xhtml, and not just text,
> > > > >   the content was not read correctly.
> > > > > - Fixed issue 17 from the public issue list. XHTML content was not
> > > > > persisted correctly.
> > > > > - Added support for hosted domain feeds. This is done automatically, 
> > > > > no
> > > > > codechanges needed for the application developer.
> > > > >   The authentication code was changed to ask for Hosted domains first,
> > > > > then google accounts.
> > > > > - Added support for the app:control/app:draft element, but only in 
> > > > > the way
> > > > > to expose a boolean on the AtomEntry.
> > > > >   The new member on AtomEntry is called IsDraft.
> > > > > - Changed the way atom:content is parsed. Text & HTML types use
> > > > > xmlreader.ReadString() to get the inner content. XHTML and
> > > > >   all other types use readInnerXml() to get the content.
> > > > > - changed Exception handling. The code now throws more detailed 
> > > > > exceptions
> > > > > based on what was happening:
> > > > >   -> GDataRequestException: generic exception
> > > > >   -> GDataForbiddenException: exception thrown when the server return 
> > > > > a
> > > > > Forbidden on authentication
> > > > >   -> GDataRedirectException: exception thrown when the server 
> > > > > returned a
> > > > > redirect
> > > > > - changed redirect handling on Post. The library will follow 
> > > > > redirects on
> > > > > Post automatically by default, to accomodate Blogger (which
> > > > >   currently may return 302s on posts). This can be turned off by 
> > > > > setting
> > > > > the .StrictRedirect property to true on the
> > > > >   GDataAuthRequestFactory. If it is turned off, the code will throw 
> > > > > if a
> > > > > redirect is happening on an HTTP verb other than GET.
> > > > > - changed redirect handling for DELETE/PUT the same as for POST
> > > > > - removed cookie handling. The code will handle cookies now without 
> > > > > using
> > > > > the CookieContainer (one hurdle on the way to the CompactFramework 
> > > > > Port).
> > > > > - Fixed persistence of "initialized" date values for 
> > > > > udpated/published on
> > > > > the atom.entry. This resolves an issue with the Blogger.
> > > > > - Added EventEntry.Notifications. This property (boolean) indicates 
> > > > > if an
> > > > > update on an entry should send notifications to the attendees of the
> > > > >   Event.
> > > > > - Fixed the gbase project (the NumberFormat.cs file was missing in the
> > > > > project file).
> > > > > - Added a proxy property for the GDataRequestFactory.
> > > > > - Setting content-length correctly to fix WindowsMobile issues. This 
> > > > > fix
> > > > > is a user submitted, and created by Steeve Morin
> > > > > - Fixes to the authsub code, provided by Ryan Boyd
> > > > > - The DLLs were renamed, to follow the Windows .NET standard.
> > > > >     gdata.dll     ->     Google.GData.Client.dll
> > > > >     gbase.dll     ->     Google.GData.GoogleBase.dll
> > > > >     gcalendar.dll     ->     Google.GData.Calendar.dll
> > > > >     gcodesearch.dll    ->     Google.GData.CodeSearch.dll
> > > > >     gextensions.dll    ->    Google.GData.Extensions.dll
> > > > >     and the new one ->     Google.GData.Spreadsheets.dll- Hide quoted 
> > > > > text -- Show quoted text -- Hide quoted text -- Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to