Using a web service instead of Flicker

Jan 28, 2009 at 12:16 AM
I have a web service that returns an array of string that has image URLs. How do I use that instead of Flicker?
Coordinator
Jan 28, 2009 at 9:12 AM
You'll need to implement a photoalbum and a slideprovider. The photoalbum class derives from Album and provides the Uri and forms the SlideProvider factory. The slide provider processes the data (in your case the arrays of strings) and returns a list of ImageSlideInfo instances.

For more details see the implementation of InterestingnessAlbum and FlickrSlideProvider.

Hope this helps
Jan 28, 2009 at 7:50 PM

My web service is at:

http://www.justthinkart.com/webservices/getstudents_ws.asmx

with one int parameter. How should I modify the following:

        public override Uri CreateLoadSlidesUri(int page)

        {

            StringBuilder result = new StringBuilder();

            result.Append("http://api.flickr.com/services/rest/?method=flickr.interestingness.getList");

            result.AppendFormat("&api_key={0}", FlickrSlideProvider.ApiKey);

            result.AppendFormat("&page={0}&per_page={1}", page, this.PageSize);

            if (this.Date.HasValue && this.Date.Value != DateTime.MinValue)

            {

                result.AppendFormat("&date={0:yyyy-MM-dd}", this.Date.Value);

            }

            return new Uri(result.ToString());

        }

From: koenz [mailto:notifications@codeplex.com]
Sent: Wednesday, January 28, 2009 2:13 AM
To: yaip.net@gmail.com
Subject: Re: Using a web service instead of Flicker [silverlightslideshow:45433]

From: koenz

You'll need to implement a photoalbum and a slideprovider. The photoalbum class derives from Album and provides the Uri and forms the SlideProvider factory. The slide provider processes the data (in your case the arrays of strings) and returns a list of ImageSlideInfo instances.

For more details see the implementation of InterestingnessAlbum and FlickrSlideProvider.

Hope this helps

Read the full discussion online.

To add a post to this discussion, reply to this email (silverlightslideshow@discussions.codeplex.com)

To start a new discussion for this project, email silverlightslideshow@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Jan 28, 2009 at 10:24 PM

For me to write my own provider, can you provide an empty XML skeleton it expects?

Jan 29, 2009 at 3:32 AM

I am building my own XML and passing it to the SlideProvider as a MemoryStream like such:

        private Stream xxx()

        {

            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Indent = true;

            MemoryStream ms = new MemoryStream();

            using (XmlWriter writer = XmlWriter.Create(ms, settings))

            {

                writer.WriteStartDocument();

                writer.WriteStartElement("rsp");

  ………………..

                writer.WriteEndElement();

                writer.WriteEndDocument();

                writer.Flush();

            }

            return ms;

        }

And I modified the “using” statement to have:

            using (StreamReader reader = new StreamReader(xxx()))

But it tells me ‘root element missing’.

Jan 29, 2009 at 6:45 PM

I am able to load slides from my own source. However, as soon as the slide is displayed in the browser, I get “System.Net.WebException” error in a prompt window. The title of the window says “Slide Provider failed to load slides”.

Coordinator
Jan 29, 2009 at 8:15 PM
yaip: you're asking very basic questions (you are not the only one) and I simply don't have the time to help everyone having issues with exceptions such as 'root element missing'. These are basic errors that are easy to master and solve once you understand the concept of XML. Apologies if this may offend you, that's not intended.
Jan 29, 2009 at 9:30 PM

Absolutely not. I really appreciate your input.

Jan 30, 2009 at 3:47 AM
Jan 30, 2009 at 5:04 PM

How can I auto-start the slide show?