Download presentation
Presentation is loading. Please wait.
Published byCornelia Matthews Modified over 9 years ago
2
Silverlight 2 has rich networking support SOAP/XML Web services via WCF proxies Untyped HTTP services (REST, RSS, ATOM) via HttpWebRequest and WebClient Socket support, asset downloads over HTTP, syndication classes, and more Also supports WCF duplex services and ADO.NET data services ("Astoria")
3
Allowed if target domain has XML policy file in place permitting calls from other domains Crossdomain.xml – Requires domain="*" allowing calls from any domain Clientaccesspolicy.xml – Can allow access to all domains or specified domains Policy file must be located at domain root http://msdn2.microsoft.com/en-us/library/cc197955(VS.95).aspx
6
Event-based HTTP networking API Commonly used to download assets DownloadStringAsync - String OpenReadAsync – Stream (binary) Can also be used to call untyped services Fires progress and completion events and supports cancellation of pending requests Event handlers execute on UI thread
9
Delegate-based HTTP networking API Supports asynchronous operation only Does NOT support relative URIs! Generally used to call untyped HTTP services (e.g., REST services) Completion methods called on background threads
11
Callable through WCF Web service proxies Use Visual Studio's "Add Service Reference" command to generate proxies SOAP services and script-callable ASP.NET AJAX (JSON) services supported ASP.NET AJAX page methods not supported Asynchronous calls only
12
Callable through WCF Web service proxies Use Visual Studio's "Add Service Reference" command to generate proxies WS-I Basic Profile 1.0 (SOAP 1.1 over HTTP) For WCF, BasicHttpBinding Textual XML encoding only Asynchronous calls only
13
Silverlight can integrate with WCF duplex services to implement push model for data Client transmits Net Duplex request to initiate connection Server uses WS-Make Connection to open callback channel for transmitting data Client "listens" on callback channel http://petermcg.wordpress.com/2008/09/03/silverlight-polling-duplex-part-1-architecture/
14
Silverlight supports socket connections System.Net.Sockets.Socket class Policy file required even for same domain Connection must be made from client Restrictions Ports 4502-4532 only Host identified by host name, not IP TCP only (no UDP)
15
Consuming Amazon's RESTful Services with Silverlight 2
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.