Mike Taulty DevDays 2010 Silverlight 4 Networking

  • 1,224 views
Uploaded on

 

More in: Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,224
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
9
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Change the Rules Silverlight 4 – Networking Mike Taulty, Microsoft UK mtaulty@microsoft.com mtaulty.com @mtaulty
  • 2. browser launched, rich internet apps
  • 3. have limited local access files hardware software ...
  • 4. different types of Silverlight 4 apps
  • 5. rich, controlled network access is key firewall
  • 6. being network aware is useful
  • 7. all network access is asynchronous your code not your code
  • 8. network stack sketch
  • 9. lots of capabilities to choose from • network protocols – HTTP, TCP, UDP • data encodings – text, binary • data serialization – XML, JSON, RSS, ATOM • messaging protocols – SOAP, REST, OData • messaging patterns – request  response, duplex, multicast • programming models – raw HTTP, WCF, WCF Data Services, sockets • security – cross-site, authentication, cross-scheme
  • 10. and two key classes for HTTP itself • WebClient – simple, easier to use • (Http)WebRequest – more functionality, slightly more complex code
  • 11. cross-domain security policy
  • 12. there are two http stacks verbs: GET, POST automatic cookie management ( restricted ) set of request headers automatic authentication status codes: LIMITED ( 200, 400 ) verbs: ALL manual cookie management ( restricted ) set of request headers response headers & body authentication ( code & automatic ) status codes: ALL
  • 13. switching between stacks
  • 14. Change the Rules demo reaching out with HTTP
  • 15. lots of capabilities to choose from • network protocols – HTTP, TCP, UDP • data encodings – text, binary • data serialization – XML, JSON, RSS, ATOM • messaging protocols – SOAP, REST, OData • messaging patterns – request  response, duplex, multicast • programming models – raw HTTP, WCF, WCF Data Services, sockets • security – cross-site, authentication, cross-scheme
  • 16. sockets • support for streaming TCP sockets – Silverlight is a socket client, not a server – consider WCF netTCP as a better option • security – limited to ports 4502 to 4534 – policy file authorisation required - HTTP or TCP download – these restrictions do not apply to trusted applications
  • 17. sockets • support for multicast UDP sockets – both single source & any source multicasting • programmability is via – Udp[Single/Any]SourceMulticastClient classes • security – port numbers must be above 1024 – policy file authorisation required – UDP download – these restrictions do not apply to trusted applications
  • 18. multicast security for any source multicasting, the Silverlight client multicasts to the multicast group on port 9430 and waits for an authorisation
  • 19. Change the Rules demo reaching out with sockets
  • 20. lots of capabilities to choose from • network protocols – HTTP, TCP, UDP • data encodings – text, binary • data serialization – XML, JSON, RSS, ATOM • messaging protocols – SOAP, REST, OData • messaging patterns – request  response, duplex, multicast • programming models – raw HTTP, WCF, WCF Data Services, sockets • security – cross-site, authentication, cross-scheme
  • 21. WCF subset in Silverlight for HTTP/TCP • transports - HTTP(S) and TCP • encodings - text and binary • serialization - DataContract* & XmlSerializer* • protocols - WS-I Basic Profile 1.1 – XML, HTTP, SOAP and WSDL – SOAP 1.2, WS-Addressing 1.0, WS-Security* • patterns - req/resp, duplex*, polled duplex* • privacy - HTTPS • authN - transport or message credential • faults - only available on the client stack
  • 22. Change the Rules demo reaching out with WCF via HTTP/TCP
  • 23. lots of capabilities to choose from • network protocols – HTTP, TCP, UDP • data encodings – text, binary • data serialization – XML, JSON, RSS, ATOM • messaging protocols – SOAP, REST, OData • messaging patterns – request  response, duplex, multicast • programming models – raw HTTP, WCF, WCF Data Services, sockets • security – cross-site, authentication, cross-scheme
  • 24. RESTful services ( generically ) Resources HTTP Request URL Res 1 VERB GET Res 2 Payload POST Res 3 PUT Res 4 XML JSON DELETE HTTP Response Status Payload XML JSON
  • 25. RESTful services ( more specifically ) • Open Data Protocol ( odata ) – www.odata.org – published under the Open Specification Promise • Extends the AtomPub standard to add – an addressing scheme – a mechanism for schema – alternate representation – JSON – handling for concurrent updates – handling for batched requests
  • 26. WCF Data Services ( “Astoria” ) • implementation of odata for the client and the server http://server/customers(‘alfki’)/Orders?$top=20
  • 27. Change the Rules demo reaching out with WCF Data Services
  • 28. resources • Channel 9 Silverlight 4 MEF Screencasts – channel9.msdn.com/tags/SL4Networking • Silverlight .NET – www.silverlight.net
  • 29. thank you for coming – please provide feedback  
  • 30. Change the Rules Silverlight 4 – Networking Mike Taulty, Microsoft UK mtaulty@microsoft.com mtaulty.com @mtaulty