| By Michael S. Scherotter | Article Rating: |
|
| November 6, 2007 08:45 AM EST | Reads: |
14,420 |
Michael Scherotter's Synergist BlogOver 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!
Published November 6, 2007 Reads 14,420
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
- How To Create a Silverlight App That Consumes a POX Service
- Silverlight and Astoria - First Impressions
- Silverlight and Moonlight
- AJAX, Flash, Silverlight, or JavaFX: Must We Choose?
- Microsoft Releases Silverlight 1.0
- Cynergy Continues Expansion of Microsoft Silverlight Practice
- Wow! Is Silverlight Hot!- All I Did Was Offer...
- Most .NET Developers Are Playing with Blend and Silverlight
- Google's OpenSocial Initiative Gains Massive Momentum
- OpenSocial: "It's Good for Developers" Says Google's Joe Kraus
- The OpenSocial Era of Cross-Network Social Applications Begins
- Microsoft Silverlight Jives With Google's OpenSocial
- Fifty Million Facebook Users Don't Care About Google's OpenSocial APIs
- Google's OpenSocial: A Technical Overview and Critique
- Google Goes On Disrupting: Last Week OpenSocial, This Week Open Phones
- Plaxo Is First Site To Publicly Implement OpenSocial
More Stories By 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.
![]() |
Michael S. Scherotter 11/06/07 09:14:27 AM EST | |||
You can read more about Silverlight and OpenSocial on my blog at http://blogs.msdn.com/synergist. |
||||
![]() |
netBear 11/06/07 08:59:30 AM EST | |||
Does Flash work with OpenSocial? |
||||
- Cloud Expo New York: Why PostgreSQL is the Database for the Cloud
- Cloud Expo New York Speaker Profile: Dave Linthicum – Blue Mountain Labs
- Agile Adoption – Crossing the Chasm
- Cloud Expo New York: The Java EE 7 Platform - Developing for the Cloud
- Write Once Run Anywhere or Cross Platform Mobile Development Tools
- Cross-Platform Mobile Website Development – a Tool Comparison
- Cloud Expo New York: Cloud Architectures Require Scale-Out Storage
- Cloud Expo New York: The Growing Big Data Tools Landscape
- Architecture Governance – the TOGAF Way
- Big Data – A Sea Change of Capabilities in IT
- Cloud Expo New York: Cloud Computing and Healthcare
- Cloud Expo New York: Mobilizing Enterprise Applications for the Cloud
- Cloud Expo New York: Why PostgreSQL is the Database for the Cloud
- Cloud Expo New York Speaker Profile: Dave Linthicum – Blue Mountain Labs
- Agile Adoption – Crossing the Chasm
- Red Hat Executive Appointed to Technology Services Industry Association (TSIA) Support Services Advisory Board
- Graal, a Dynamic Java Compiler in the Works
- Cloud Expo New York: The Java EE 7 Platform - Developing for the Cloud
- Write Once Run Anywhere or Cross Platform Mobile Development Tools
- Cross-Platform Mobile Website Development – a Tool Comparison
- Cloud Expo New York: Cloud Architectures Require Scale-Out Storage
- What Motivates Open Standards in the Cloud?
- Cloud Expo New York: The Growing Big Data Tools Landscape
- Architecture Governance – the TOGAF Way
- The i-Technology Right Stuff
- The Top 150 Players in Cloud Computing
- Who Are The All-Time Heroes of i-Technology?
- Where Are RIA Technologies Headed in 2008?
- Get the Message
- ESB Myth Busters: 10 Enterprise Service Bus Myths Debunked
- i-Technology Viewpoint: Is Web 2.0 the Global SOA?
- i-Technology Viewpoint: Thinking Outside the VC Box
- i-Technology Viewpoint: When to Leave Your First IT Job
- SOA Web Services Edge Conference Coverage on SYS-CON.TV
- SYS-CON.TV's "SOA Web Services" and "Enterprise Open Source" Programs To Air in December
- Five Reasons Why Web 2.0 Matters





















