Feeds

Silverlight 2.0 data and web services explained

Mashups and large downloads challenge

Combat fraud and increase customer satisfaction

Mix 08 Microsoft Silverlight team member Eugene Osovetsky has explained to a packed Mix 08 session how Silverlight 2.0, released as beta on Wednesday, interacts with external data and web services.

No surprise: the first thing we saw was based on the Windows Communication Foundation (WCF), 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, or generic web services using XML or JSON, 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, 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.®

3 Big data security analytics techniques

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Inside the Hekaton: SQL Server 2014's database engine deconstructed
Nadella's database sqares the circle of cheap memory vs speed
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
IRS boss on XP migration: 'Classic fix the airplane while you're flying it attempt'
Plus: Condoleezza Rice at Dropbox 'maybe she can find ... weapons of mass destruction'
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
New Facebook phone app allows you to stalk your mates
Nearby Friends feature goes live in a few weeks
prev story

Whitepapers

Top three mobile application threats
Learn about three of the top mobile application security threats facing businesses today and recommendations on how to mitigate the risk.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
SANS - Survey on application security programs
In this whitepaper learn about the state of application security programs and practices of 488 surveyed respondents, and discover how mature and effective these programs are.