Original URL: http://www.channelregister.co.uk/2008/03/06/silverlight_two_data_services/
Mix 08 Microsoft Silverlight team member Eugene Osovetsky has explained to a packed Mix 08 session how Silverlight 2.0, released as beta (http://www.microsoft.com/silverlight/resources/installationfiles.aspx?v=2.0) on Wednesday, interacts with external data and web services.
No surprise: the first thing we saw was based on the Windows Communication Foundation (WCF) (http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx), Microsoft's universal .NET web services API.
Presuming you use ASP.NET and Visual Studio, this involves creating a WCF service by marking up .NET code with attributes such as ServiceContract and DataContract, then consuming the service in a Silverlight application by adding a Service Reference and coding against it. Silverlight requires AJAX-style asynchronous calls to a proxy class, with the results processed in a callback event handler. Silverlight has rich bindable data controls including a listbox and a datagrid.
That's all well and good, but not everyone wants or can use end-to-end .NET. Fortunately Silverlight also supports standard SOAP by importing a WSDL (http://www.w3schools.com/wsdl/wsdl_intro.asp), or generic web services using XML or JSON (http://www.json.org/), though a little more code is needed. Once again, the Silverlight code involves asynchronous calls, this time using a generic WebClient class that will already be familiar to .NET programmers.
There are complications with REST (http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci823682,00.html), though. The problem is that Silverlight, like Adobe Systems' Flash, does not have its own networking stack but relies on the browser's plug-in API. This gets you benefits like sharing the browser's authenticated connections, but also brings limitations.
Apparently it is simply not possible to use HTTP PUT or DELETE methods, a problem that leads to hacks like HTTP POSTs that delete data, breaking the HTTP specification. This is not the fault of Silverlight, but it is unfortunate. For similar reasons, there is no access to SOAP fault messages.
There is also a big issue with cross-domain data sources, which poses a problem for mash ups. Cross-domain access is prevented by default for security reasons. Otherwise, a bad Silverlight application might hijack an existing authenticated connection to some other site.
Cross-domain data is the essence of mash ups, though. The solution with Silverlight is that services can opt in to being called cross domain by including a policy file. Silverlight has its own, or will observe a Flash policy file. Therefore, public services that work with Flash should also work with Silverlight. Cross-domain access over SSL is promised, but not supported in the current beta.
Osovetsky remarked that Silverlight 2.0 has moved away from JSON towards SOAP, saying that JSON has little advantage if the client code is not JavaScript, though he admitted that JSON has a smaller message size. Microsoft is investigating binary XML for Silverlight, but it seems unlikely this will make the first release.
This puts Silverlight at a disadvantage to Flash for downloading large amounts of data, since Flash can use Adobe's efficient ActionScript Message Format. In mitigation, Silverlight is inherently flexible and there is plenty of scope for custom solutions.®
Silverlight 2 beta 2 - Go Live if you dare (9 June 2008)
http://www.theregister.co.uk/2008/06/09/silverlight_2_beta_2_review/
Windows XP bests OS X in RIA test on Intel (23 May 2008)
http://www.channelregister.co.uk/2008/05/23/ria_benchmarks/
W3C 'clarifies' HTML 5 v XHTML (16 May 2008)
http://www.theregister.co.uk/2008/05/16/html5_xhtml_vendors_lockin/
Visual Studio update dents Silverlight development (13 May 2008)
http://www.theregister.co.uk/2008/05/13/visual_studio_2008_sp1_beta_silverlight2/
Back to the future: the Java client’s second go-round (12 May 2008)
http://www.channelregister.co.uk/2008/05/12/javaone_outing/
Adobe lifts Flash and AIR development restrictions (1 May 2008)
http://www.channelregister.co.uk/2008/05/01/adobe_open_access_protocols/
Adobe veteran joins Microsoft media camp (29 April 2008)
http://www.theregister.co.uk/2008/04/29/microsoft_adobe_hire/
Sun plans JavaFX RIA tease for JavaOne (23 April 2008)
http://www.theregister.co.uk/2008/04/23/sun_javafx_profiles/
Google sneaks under standards radar (16 April 2008)
http://www.channelregister.co.uk/2008/04/16/google_de_facto_geographic_standard/
Security experts warn against Web 2.0 charlatans and 'premature AJAXulation' (14 April 2008)
http://www.theregister.co.uk/2008/04/14/ajax_charlatans_old_school_attack/
The trinity of RIA security explained (8 April 2008)
http://www.channelregister.co.uk/2008/04/08/ria_security/
Is Google Gears safe? (2 April 2008)
http://www.channelregister.co.uk/2008/04/02/security_google_gears/
Google hippie code trip delayed again (1 April 2008)
http://www.theregister.co.uk/2008/04/01/google_summer_code_delay/
Open AJAX frameworks not fit for 'power users' (28 March 2008)
http://www.channelregister.co.uk/2008/03/28/ajax_analyst_reversal/
Microsoft Mobile presses Flash (17 March 2008)
http://www.theregister.co.uk/2008/03/17/windows_mobile_flash/
Quick scripting for .NET with IronPython (13 March 2008)
http://www.channelregister.co.uk/2008/03/13/ironpython_part_one/
Microsoft reveals its database for the cloud (10 March 2008)
http://www.channelregister.co.uk/2008/03/10/microsoft_database_cloud/
'Fuzzy' royalties policies challenge Microsoft's open API pledge (7 March 2008)
http://www.channelregister.co.uk/2008/03/07/royalties_microsoft_apis/
Microsoft indemnifies Novell Moonlight users (6 March 2008)
http://www.channelregister.co.uk/2008/03/06/microsoft_moonlight_patent_protection/
Microsoft plays IE 8 interoperability pick and mix (6 March 2008)
http://www.channelregister.co.uk/2008/03/06/ie8_standards_roadmap/
Microsoft architecture chief 'clarifies' online formula (5 March 2008)
http://www.theregister.co.uk/2008/03/05/ozzie_microsoft_services/
Nokia boards Silverlight express (4 March 2008)
http://www.theregister.co.uk/2008/03/04/s60_silverlight/
Microsoft's LAMP answer arrives in pieces (27 February 2008)
http://www.theregister.co.uk/2008/02/27/windows_server_2008_launch/
Microsoft and Adobe jockey on rich applications (25 February 2008)
http://www.theregister.co.uk/2008/02/25/microsoft_adobe_ria_internet_explorer/
Sun's JavaFX tools to interop with Adobe (24 January 2008)
http://www.channelregister.co.uk/2008/01/24/javafx_tools_adobe/
Build a Silverlight media player (9 January 2008)
http://www.channelregister.co.uk/2008/01/09/silverlight_media_application_service/
Get stuck in to Visual Studio 2008 (18 December 2007)
http://www.channelregister.co.uk/2007/12/18/visual_studio_2008_review/
Google's next web toolkit thinks it's better than you (7 December 2007)
http://www.channelregister.co.uk/2007/12/07/google_gwt_performance/
Project Astoria a hit at TechEd (13 November 2007)
http://www.channelregister.co.uk/2007/11/13/project_astoria/
Get started with Silverlight (5 November 2007)
http://www.channelregister.co.uk/2007/11/05/get_started_with_silverlight/
Considering Microsoft’s 'rift with the web' (23 October 2007)
http://www.theregister.co.uk/2007/10/23/microsoft_dot_net/
Don't get stuck with AJAX, Oracle warns (25 September 2007)
http://www.theregister.co.uk/2007/09/25/oracle_ajax_jsf/
MS shines Silverlight into thin AIR (and kicks 'beaten up' Google Gears) (17 September 2007)
http://www.theregister.co.uk/2007/09/17/microsoft_loves_silverlight_slams_adobe_air_google_gears/
© Copyright 2008