YOUR FEEDBACK
Michael S. Scherotter wrote: You can read more about Silverlight and OpenSocial on my blog at http://blogs.msdn.com/synergist.
netBear wrote: Does Flash work with OpenSocial?

READ DIGITAL EDITION


SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


How OpenSocial Complements Silverlight
"Thank you Google for making Silverlight better!"

Michael Scherotter's Synergist Blog

Over the weekend, my challenge was to learn about OpenSocial and create a Silverlight application that uses it. I did that, with this simple application. To take advantage of the OpenSocial implementation in Orkut sandbox, you have to create a Google Gadget with the OpenSocial feature, post the gadget on the Internet, and then add the URL of the gadget as an application. 

As I looked into the Google gadget API to build this, I found something interesting, the Google Gadget framework exposes the function _IG_FetchContent() that can be used to asynchronously fetch the text at any URL.  This is called cross-domain data access and if enabled in the browser, it opens up a very big security hole. One of the challenges in writing Silverlight applications that run in a secure browser sandbox is that they can't access data from a different domain. 

For example, if your site is http://blogs.msdn.com, your Silverlight client-side JavaScript can't get data from Web 2.0 services like Twitter at the URL http://twitter.com/statuses/friends_timeline/Synergist.xml and render it out in Silverlight.  To do this in Silverlight today, you have to either do some server-side code to create a bridge or proxy web service that routes the service on the server.  It isn't hard, but it's another step that you have to take, and the server-side code for a PHP website would be different than the code for an ASP.Net website.  I am told that the next version of Silverlight, 1.1, will have a better way of doing that. 

Mash-up and Gadget Frameworks

Other options are to use mash-up and gadget frameworks like Microsoft's Popfly, Yahoo! Pipes, or Google Gadgets that implement this cross-domain data access for you. 

Since OpenSocial applications in Orkut are based on Google Gadgets, it is possible for Silverlight OpenSocial applications in Orkut to take advantage of these Google Remote Content APIs to make cross-domain calls. This can be used to call Web 2.0 services or to composite your Silverlight application from XAML residing on various domains.  Where you would use Silverlight's Downloader object for same-domain data and services, you would use the _IG_FetchContent() and _IG_FetchXmlContent() to access data from external domains.  Here's how I've used it to download XAML from cross domains and populate the Silverlight Scene graph:

var m_root = null;

function OnLoad(sender, context, source)
{
  m_root = source;
 
  _IG_FetchContent("http://hosting.gmodules.com/ig/gadgets/file/
    113009390747258006757/OpenSocial.xaml
", GotXaml)
 
}

function GotXaml(xaml)
{
    var host = m_root.getHost();
    var canvas = host.content.CreateFromXaml(xaml);
   
    m_root.children.Clear();
   
    m_root.children.Add(canvas);
}

Now that's Synergy!

Thank you Google for making Silverlight better!

About Michael S. Scherotter
A developer evangelist for Microsoft's Communications Sector of North America, Michael S. Scherotter is based in the San Francisco Bay Area.

YOUR FEEDBACK
Michael S. Scherotter wrote: You can read more about Silverlight and OpenSocial on my blog at http://blogs.msdn.com/synergist.
netBear wrote: Does Flash work with OpenSocial?
SYMBIAN LATEST STORIES . . .
Keynote Systems has expanded its on-demand mobile test and measurement network to include Beijing, China; Chennai, India; Mexico City, Mexico and Madrid, Spain. Keynote and its subsidiary Keynote SIGOS give its customers the ability to test mobile performance in over 700 locations on o...
Symbian welcomes the availability of the Nokia 6650, a mainstream mobile phone from AT&T. The Nokia 6650 is based on Symbian OS v9.3, designed with performance and feature enhancements, including support for location based services, to bring the highest level of power efficiency and pl...
Sybase 365 manages inter-carrier messaging services for more than 3 billion of the estimated 3.7 billion mobile subscribers worldwide, and for more than 700 mobile operators worldwide. Sybase 365's systems process more than 100 billion messages annually. With responsibility for over 80...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
Keynote Systems has expanded its on-demand mobile ...
Symbian welcomes the availability of the Nokia 665...
Sybase 365 manages inter-carrier messaging service...
VMware, the bruised and bloodied virtualization le...
VMware has announced plans to bring virtualization...
When the economy takes a hit, so do cell phone sal...
In the midst of iPhone mania, Android frenzy, and ...
AT&T Mobile CEO Ralph De La Vega announced on Mond...
Last couple of days as I watch the election covera...
Venice Consulting Group (VCG), a leading software...
BREAKING SYMBIAN NEWS

Mobile communications and commerce enabler Netsize today announced that Gameloft, a...