5 messages in com.googlegroups.google-picasa-data-apiRe: Picasaservice question (getting a...
FromSent OnAttachments
Mahesh09 Feb 2008 07:51 
Ryan Boyd (Google)09 Feb 2008 08:54 
Mahesh10 Feb 2008 09:44 
Mahesh15 Feb 2008 13:43 
Ryan Boyd (Google)16 Feb 2008 08:08 
Subject:Re: Picasaservice question (getting an error)
From:Mahesh (mohi@gmail.com)
Date:02/15/2008 01:43:56 PM
List:com.googlegroups.google-picasa-data-api

Hi Ryan,

Wondering, if you could please help provide the solution for this problem.

Thanks,

Hi Ryan,

Thanks for the response. It worked fine now. But when I pass the album name, that has more than 1 word with spaces in between, I am getting error. If I pass the name that has no spaces then it works fine.

Code I am using is: PhotoQuery query = new PhotoQuery(PicasaQuery.CreatePicasaUri("default", "Album Name"));

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Error Message: The remote server returned an error: (404) Not Found. 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: System.Net.WebException: The remote server returned an error: (404) Not Found.

Source Error:

Line 42: PhotoQuery query = new PhotoQuery(PicasaQuery.CreatePicasaUri("default", "Album Name")); Line 43: Line 44: PicasaFeed feed = service.Query(query); Line 45: Line 46: foreach (PicasaEntry entry in feed.Entries)

On Feb 9, 10:55 am, "Ryan Boyd (Google)" <api.@google.com> wrote:

Hi Mahesh,

The PWA API has support for heterogeneous feeds -- different kinds of entry objects in each feed. For instance, you could have comments, photos and albums all returned as part of the same feed. I suspect what is happening here is that you are retrieving a list of albums rather than a list of photos, as the AlbumQuery class in the .NET client library generates a URL with a kind=album. You can tell for sure by looking at the generated Uri property of the query class, and retrieving that in your web browser.

Here's the reference list of different kinds and which feeds they are available in:http://code.google.com/apis/picasaweb/reference.html#Kind

Cheers, -Ryan

On Feb 9, 2008 7:51 AM, Mahesh <mohi@gmail.com> wrote:

Hello,

I am using following piece of code to access the album and the details of photos using .net but I am getting this error (See the code I am using below the error message) Error: Entry is not a photo Parameter name: entry 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: System.ArgumentException: Entry is not a photo Parameter name: entry Source Error: Line 50: Line 51: Line 52: PhotoAccessor ac1 = new PhotoAccessor(entry); Line 53: string albumId = ac1.AlbumId; Line 54: string photoId = ac1.Id;

-------------------------------------------------------------------------------------------------------------------------------------------- Soruce Code: PicasaService service = new PicasaService("exampleCo-exampleApp-1"); service.setUserCredentials("a.@gmail.com", "password");

AlbumQuery query = new AlbumQuery(PicasaQuery.CreatePicasaUri("abc")); PicasaFeed feed = service.Query(query); pics.Text=""; foreach (PicasaEntry entry in feed.Entries) { pics.Text += entry.Title.Text+"<br>"; AlbumAccessor ac = new AlbumAccessor(entry); pics.Text += Convert.ToString(ac.NumPhotos )+"<br>";

PhotoAccessor ac1 = new PhotoAccessor(entry); string albumId = ac1.AlbumId; string photoId = ac1.Id; string camera = ""; if (entry.Exif.Make != null && entry.Exif.Model != null) { camera = entry.Exif.Make.Value + " " + entry.Exif.Model.Value; } string contentUrl = entry.Media.Content.Attributes["url"] as string; //grab the URL of the first thumbnail string firstThumbUrl = entry.Media.Thumbnails[0].Attributes["url"] as string;

pics.Text += "AlbumID: " + albumId+"<br>"; pics.Text += "PhotoID: " + photoId+"<br>"; pics.Text += "Camera: " + camera+"<br>"; pics.Text += "Content URL: " + contentUrl+"<br>"; pics.Text += "First Thumbnail: " + firstThumbUrl+"<br>";