Oct 24, 2007

Talking to the Outside World from Silverlight 1.1: An Introduction

(This post is basically a recap of the introduction part of my REMIX 07 Boston Talk )

Silverlight applications run in the user's browser. We all know about the rich graphics and interactivity that Silverlight provides. But any real-world application will, at some point, need to communicate with the "outside world".

This interaction can take many forms. The simplest one (at least from a developer's point of view) is accessing media from some remote server: you can display an image or play a video from any URL. This capability exists even in the 1.0 version of Silverlight. However, it is limited to only certain types of data - images, videos and sounds.

The next step up is being able to work with arbitrary blobs of data and then write code to make sense of them. In 1.0, your only option was to use JavaScript on the page that hosts your Silverlight control. You could use standard AJAX techniques: use XmlHttpWebRequest to GET any data from some HTTP location and then use JavaScript to adjust your Silverlight graphics accordingly. You could also POST any data to some HTTP location.

In 1.1, there is no need for external JavaScript - you can use the BrowserHttpWebRequest .NET class (a subclass of HttpWebRequest) directly from your Silverlight application to issue GET/POST requests with a Stream of bytes.

But what if you want to work with more than just bytes? Most data has some structure to it: You may be receiving data in XML or JSON format that you will want to parse, or getting an RSS feed that you want to process and then display, or you may be talking to a SOAP service that actually describes its structure using metadata. In other words, you are not just working with bytes but with products, search results or high scores - data that matters to your app. The data may come from a service you yourself create, or from some "mashup-friendly" source like Flickr or Facebook.

This is exactly the problem I am working on within the overall Silverlight effort, and what many of the posts here will be about - how do we make it easy to work with structured data - that is, how do you consume "services" (in the widest sense of the word)? Watch this blog to discover what is planned in this space, and of course leave comments if you have any ideas or feedback!

I should note that most of the information here will be about SL1.1. In the existing SL1.0 (and in 1.1 as well of course) you can use all of the usual AJAX techniques as I already mentioned. In fact, Fritz Onion did a great talk at REMIX on integrating Silverlight 1.0 with ASP.NET AJAX - you can do some pretty powerful things with this combination - check out the Channel9 videos (Parts 1 2 3 4) and sample code.

34 comments:

Mesquite Texas Yellow Pages said...

Awesome! I have read a lot on this topic, but you definitely give it a good vibe. This is a great post. Will be back to read more! Please come visit my site Mesquite Texas Yellow Pages when you got time.

Fullerton California said...

I wanted to thank you for this great read!! I definitely enjoying every little bit of it :) I have you bookmarked to check out new stuff you post. Please visit my Please visit my blog when you have time Please come visit my site Fullerton California when you got time.

Jacksonville Business Directory said...

I forgot about those! Maybe they look good w/ the right outfit? I didn't like skinny jeans when I first saw them. lol. Please come visit my site Jacksonville Florida FL when you got time.

Indianapolis Business Directory said...

I'm glad you're back to posting. I love reading about your shopping adventures and great finds. Your outfits are always super cute too! Very inspirational. Please come visit my site Indianapolis Business Search and give me any valuable feedbacks.

Anonymous said...

Great tips. I am new to business, trying to visit more business blogs for guides and tips.
You can be friends with me. Please come visit my site Kansas City Yellow Page Business Directory when you got time. Thanks.

Anonymous said...

Nice blog design. This seems like it would be a very interesting blog to keep up with. Please come visit my site St. Louis Yellow Page Business Directory when you got time.

Reality said...

Yeah it is a great and nice article looking forward to have such article it is so useful. Please come visit my site homegrown when you got time.

youth leadership development said...

I really liked your blog! You have some great content. Check out my blog and give me some feedback Please come visit my site executive development
when you got time.

life coach business said...

Well, nice article buddy… Someone will love to read this infor if I tell her about this. She’s really interested in this subject. Thanks again… Please come visit my site wellness coaching
when you got time.

higher education said...

I really liked your blog! Please come visit my site college give me any valuable feedbacks

Anonymous said...

I found your site on google, great site, keep it up. Will return in the future. Submitted this post to Google News Reader. Please come visit my site migraine headache when you got time.

binge eating disorders said...

sorry to ask this here but… I really love your theme, would it happen to be a free one i can download somewhere, or is it a custom theme you had made? Soon i will be launching my own blog, however i’m not great with designs but i do like the style of your site so it would be excellent if i could find (or buy) something with a similar look as my last designer cannot finish my site. Thanks! Please come visit my site binge eating disorder when you got time.

telephone service said...

You may have not intended to do so, but I think you have managed to express the state of mind that a lot of people are in. The sense of wanting to help, but not knowing how or where, is something a lot of us are going through. Please come visit my site call when you got time.

answering services said...

I am not really sure if best practices have emerged around things like that, but I am sure that your great job is clearly identifed. I was wondering if you offer any subscription to your RSS feeds as I would be very interested and can’t find any link to subscribe here. Please come visit my site satellite give me any valuable feedbacks.

telephone company said...

I can see that you are putting a lot of time and effort into your blog and detailed articles! I am deeply in love with every single piece of information you post here. Will be back often to read more updates! Please come visit my site call when you got time.

Jewelry Wholesale Supplier said...

I enjoyed reading your work! GREAT post! I looked around for this… but I found you! Anyway, would you mind if I threw up a backlink from my site? Please come visit my site jewelry when you got time.

Wholesale Jewelry and Gifts Import said...

As a Newbie, I am always searching online for information that can help me. Thank you. Please come visit my site jewellery supply give me any valuable feedbacks.

Anonymous said...

This is just another reason why I like your website. I like your style of writing you tell your stories without out sending us to 5 other sites to complete the story. Please come visit my site Memphis Yellow Page Business Directory when you got time.

Anonymous said...

What a facinating article. I’m looking for a marketing expert to help with a project, could you help? Please come visit my site Business Phone Directory of San Diego California CA when you got time.

Anonymous said...

What a facinating article. I’m looking for a marketing expert to help with a project, could you help? Please come visit my site American San Diego online business directory when you got time.

costume jewelry wholesale said...

Wow, loving the two photos you posted. You got potential. Please come visit my site organic jewelry when you got time.

wholesale baby giftperacr said...

I forgot about those! Maybe they look good w/ the right outfit? I didn't like skinny jeans when I first saw them. lol. Please come visit my site garden supply give me any valuable feedbacks.

Buying Or Selling A Home said...

I really liked your blog! Please come visit my site how to buy home give me any valuable feedbacks

Natural Remedy said...

Me and my friend were arguing about an issue similar to this! Now I know that I was right. lol! Thanks for the information you post. I would love some feedback on my siteHome remedies when you got time.

Children Health said...

What a blog filled with vital and important information this is .. It must have taken a lot of hours for you to write these yourself. Hats off from me for your hard work. Please come visit my site Children's health give me any valuable feedbacks.

Anonymous said...

Yeah it is a great and nice article looking forward to have such article it is so useful. Please come visit my site CCorpus Christi Business Phone Listinge when you got time.

rr8004 said...

Awesome! I have read a lot on this topic, but you definitely give it a good vibe. This is a great post. Will be back to read more! Please come visit my site Local Business Directory Of Louisville U.S.A. when you got time.

rr8004 said...

Awesome! I have read a lot on this topic, but you definitely give it a good vibe. This is a great post. Will be back to read more! Please come visit my site Louisville City Directory when you got time.

rr8004 said...

Excellent article , i just share it with my friend of Italy. I Stumble UP your blog post , you will notice an increase of traffic within 24 hours for targeted people. Cheers . Please come visit my site Directory Of Fresno when you got time.

rr8004 said...

Excellent article , i just share it with my friend of Italy. I Stumble UP your blog post , you will notice an increase of traffic within 24 hours for targeted people. Cheers . Please come visit my site Internet Business Directory of Fresno City when you got time.

rr8004 said...

Couldn't be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing! Please come visit my site Albuquerque Yellow Page Business Directory when you got time.

rr8004 said...

Couldn't be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing! Please come visit my site Local Business Directory Of Albuquerque U.S.A. when you got time.

rr8004 said...

Wow, loving the two photos you posted. You got potential. Please come visit my site Greensboro City Business Listings when you got time.

rr8004 said...

Wow, loving the two photos you posted. You got potential. Please come visit my site Greensboro Business Directory Forum Blog Classifieds when you got time.