Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / January 2008

Tip: Looking for answers? Try searching our database.

Problem reading gmail atom feed in .NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
slishnevsky - 22 Jan 2008 02:09 GMT
Hello, I am trying to reader gmail atom feed like this
(username&password are mine of course):

XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = new NetworkCredential("username", "password");
XmlTextReader reader = new XmlTextReader("https://gmail.google.com/
gmail/feed/atom");
reader.XmlResolver = resolver;
XmlDocument document = new XmlDocument();
document.Load(reader);

==========================================================
or like this:

WebClient client = new WebClient();
client.Credentials = new NetworkCredential("username", "password");
string response = Encoding.UTF8.GetString(client.DownloadData("https://
gmail.google.com/gmail/feed/atom"));

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

But it fails with "The remote server returned an error: (401)
Unauthorized." error message. Anybody knows why?
forever.zet@gmail.com - 22 Jan 2008 16:25 GMT
> Hello, I am trying to reader gmail atom feed like this
> (username&password are mine of course):
[quoted text clipped - 19 lines]
> But it fails with "The remote server returned an error: (401)
> Unauthorized." error message. Anybody knows why?

I suppose Google uses it's own authentication/authorization scheme.
I know there are Google APIs to access some of their services. They
are here: http://code.google.com/apis/gdata/

HTH
Thanks,
Sergey Zyuzin
slishnevsky - 22 Jan 2008 18:24 GMT
On 22 янв, 11:25, "forever....@gmail.com" <forever....@gmail.com>
wrote:

> > Hello, I am trying to reader gmail atom feed like this
> > (username&password are mine of course):
[quoted text clipped - 27 lines]
> Thanks,
> Sergey Zyuzin

Thanks, I know for sure that it was possible to read gmail atom before
using the same code.
It seems that Google has changed something to gmail atom feed recently
so that it would not be possible to consume gmail atom feed anymore.
I just wonder why would they anyone do something like that, that's the
whole purpose of atom feed so that people could use it, consume it
through various rss aggregators or code.
slishnevsky - 22 Jan 2008 20:50 GMT
On Jan 22, 11:25 am, "forever....@gmail.com" <forever....@gmail.com>
wrote:

> > Hello, I am trying to reader gmail atom feed like this
> > (username&password are mine of course):
[quoted text clipped - 27 lines]
> Thanks,
> Sergey Zyuzin

By the way, I have just tried to read gmail atom feed programmatically
using GData API.
Same thing - returns error message "Invalid Credentials".

I think that to read secure feed you don't need much, I can open and
see gmail atom feed in my browser.
That means only one thing - I should be able to read it normally using
the code in my original post without any problems.
This is really strange.
slishnevsky - 23 Jan 2008 12:19 GMT
> On Jan 22, 11:25 am, "forever....@gmail.com" <forever....@gmail.com>
> wrote:
[quoted text clipped - 40 lines]
> the code in my original post without any problems.
> This is really strange.

Anyone?
forever.zet@gmail.com - 23 Jan 2008 14:24 GMT
> > On Jan 22, 11:25 am, "forever....@gmail.com" <forever....@gmail.com>
> > wrote:
[quoted text clipped - 44 lines]
>
> - Show quoted text -

I got your second sample working with this url instead: "https://
mail.google.com/mail/feed/atom"

Thanks,
Sergey
slishnevsky - 23 Jan 2008 16:14 GMT
On Jan 23, 9:24 am, "forever....@gmail.com" <forever....@gmail.com>
wrote:

> > > On Jan 22, 11:25 am, "forever....@gmail.com" <forever....@gmail.com>
> > > wrote:
[quoted text clipped - 50 lines]
> Thanks,
> Sergey

Oh, Thank you so much, man!
Now, it's working for me too ;)
Thanks!~

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.