<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>UberDemo : Web Services</title><link>http://blogs.msdn.com/uberdemo/archive/tags/Web+Services/default.aspx</link><description>Tags: Web Services</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Silverlight Slideshow (Part I)</title><link>http://blogs.msdn.com/uberdemo/archive/2006/12/13/wpf-e-slideshow-part-i.aspx</link><pubDate>Thu, 14 Dec 2006 01:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1278064</guid><dc:creator>uberdemo</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/uberdemo/comments/1278064.aspx</comments><wfw:commentRss>http://blogs.msdn.com/uberdemo/commentrss.aspx?PostID=1278064</wfw:commentRss><description>As a Software Design Engineer on the UberDemo team, I‘m very fortunate to be able to experiment with a large variety of technologies. Right now we’ve begun gearing up for MIX07, and so I was ask to put together a slideshow for the upcoming MIX07 site that utilizes the new&amp;nbsp;Silverlight technology, which just happened to be released to public on Dec 04, 2006 as the “December Community Technology Preview (CTP)”. Read &lt;A href="http://msdn2.microsoft.com/en-us/asp.net/bb187358.aspx" mce_href="http://msdn2.microsoft.com/en-us/asp.net/bb187358.aspx"&gt;more&lt;/A&gt; about Silverlight. 
&lt;P&gt;It is our team's goal to fully exploit our own technologies to create compelling prototypes and demos. Sometimes we like to push the boundaries of what a particular technology is capable of, to create an even better user experience (UX). We also typically provide feedback to the product teams, if we find issues, or feel strongly about a feature that we think needs to be added into a product early in development, or even sometimes to attempt to prevent cool features from being cut! 
&lt;P&gt;It’s my hope that readers of this blog will be able to learn from our experiences and avoid some of the pitfalls that we invariably run into when developing&amp;nbsp; demos on beta and pre-beta software. 
&lt;P&gt;In the demo that I am working on now (not complete yet), I was asked to create&amp;nbsp;&amp;nbsp;Silverlight app that cycled through a set of photos from Flickr. Silverlight, being a web friendly version of WPF, is well suited for consuming &lt;A href="http://www.flickr.com/services/api/" mce_href="http://www.flickr.com/services/api/"&gt;Flickr web services&lt;/A&gt;.&amp;nbsp;Silverlight itself doesn’t provide anything in the way of making web services easier to call, but it does provide a very performant rendering surface for the images. 
&lt;P&gt;I experimented with calling the web services using an HTTP &lt;A href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm" mce_href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm"&gt;REST&lt;/A&gt; request and requesting a JavaScript Object Notation (&lt;A href="http://en.wikipedia.org/wiki/JSON" mce_href="http://en.wikipedia.org/wiki/JSON"&gt;JSON&lt;/A&gt;) response in multiple ways, each with&amp;nbsp;advantages and disadvantages. Here are 3 ways I discovered: 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://en.wikipedia.org/wiki/Xmlhttprequest" mce_href="http://en.wikipedia.org/wiki/Xmlhttprequest"&gt;XmlHTTPRequest&lt;/A&gt; object. &lt;B&gt;Advantage&lt;/B&gt;: Can run from web client. &lt;B&gt;Disadvantage&lt;/B&gt;: In IE, throws a warning when doing cross-domain calls and exposes the Flickr API key to anyone that views source. 
&lt;LI&gt;&lt;A href="http://www.xml.com/pub/a/2005/12/21/json-dynamic-script-tag.html" mce_href="http://www.xml.com/pub/a/2005/12/21/json-dynamic-script-tag.html"&gt;Client JavaScript Request&lt;/A&gt;. &lt;B&gt;Advantage&lt;/B&gt;: Can run from web client. &lt;B&gt;Disadvantage&lt;/B&gt;: &amp;nbsp;Cross-domain call without warning (see /// A SECURITY WARNING in &lt;A href="http://developer.yahoo.com/javascript/samples/dynamic/jsr_class.js" mce_href="http://developer.yahoo.com/javascript/samples/dynamic/jsr_class.js"&gt;jsr_class.js&lt;/A&gt;), and exposes the Flickr API key to anyone that views source. 
&lt;LI&gt;Using the .NET &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemNetWebRequestClassTopic.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemNetWebRequestClassTopic.asp"&gt;WebRequest&lt;/A&gt; class from an ASP.NET page. &lt;B&gt;Advantage&lt;/B&gt;: Browser agnostic, doesn’t throw a cross-domain warning, and doesn’t expose the Flicker API key. &lt;B&gt;Disadvantage&lt;/B&gt;: requires a server component, and client-side/server-side code mingles and is a bit more convoluted. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;I went with option #3 for this demo, although I haven’t yet experimented cross-browser yet WRT this. I’m sure that this would also affect #1 and #2. It is in my plans to do this though, to insure a robust application. 
&lt;P&gt;It also should be noted that all of the above methods can suffer equally from a script injection attack when a JSON response is returned and processed, so you &lt;U&gt;really&lt;/U&gt; need to trust your source web service provider. 
&lt;P&gt;Once I was able to get a list of images as a JSON object, I now wanted to iterate through them and display and animate them, however I ran into an issue with animation. The animation required moving an Image, or in my case a Rectangle filled with an ImageBrush, through an arbitrary set of points. The problem was that if I had a multiple storyboards only the first animation occurred. Fortunately I found a workaround to this&amp;nbsp;Silverlight bug [since fixed]. 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/karstenj/archive/2006/12/13/animation-handoff-bug-and-workaround-for-current-wpf-e-ctp.aspx" mce_href="http://blogs.msdn.com/karstenj/archive/2006/12/13/animation-handoff-bug-and-workaround-for-current-wpf-e-ctp.aspx"&gt;Here&lt;/A&gt; are the specifics of the storyboard animation issue that Karsten Januszewski (a friend and fellow team member) posted for me to get it out there quickly. I wanted to get this out to a large audience so that others wouldn’t have to suffer the temporary confusion that I went through. 
&lt;P&gt;-Hans Hugli&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1278064" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/uberdemo/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/uberdemo/archive/tags/Silverlight/default.aspx">Silverlight</category></item></channel></rss>