Presentation is loading. Please wait.

Presentation is loading. Please wait.

Silverlight 2 has rich networking support SOAP/XML Web services via WCF proxies Untyped HTTP services (REST, RSS, ATOM) via HttpWebRequest and WebClient.

Similar presentations


Presentation on theme: "Silverlight 2 has rich networking support SOAP/XML Web services via WCF proxies Untyped HTTP services (REST, RSS, ATOM) via HttpWebRequest and WebClient."— Presentation transcript:

1

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

4

5

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

7

8

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

10

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

16

17


Download ppt "Silverlight 2 has rich networking support SOAP/XML Web services via WCF proxies Untyped HTTP services (REST, RSS, ATOM) via HttpWebRequest and WebClient."

Similar presentations


Ads by Google