no silverlight application is an island of richness

21
1 No Silverlight application is an island (of richness) Mike Taulty Developer & Platform Group Microsoft Ltd [email protected] http://www.miketaulty.com

Upload: ukdpe

Post on 24-May-2015

1.522 views

Category:

Technology


2 download

DESCRIPTION

No Silverlight Application Is an Island of Richness

TRANSCRIPT

Page 1: No Silverlight Application Is an Island of Richness

1

No Silverlight application is an island (of richness)

Mike TaultyDeveloper & Platform GroupMicrosoft [email protected] http://www.miketaulty.com

Page 2: No Silverlight Application Is an Island of Richness

The Silverlight Island

HTMLHTML(is humdrum)(is humdrum)

SilverlightSilverlight(is sexy)(is sexy)

Page 3: No Silverlight Application Is an Island of Richness

Island Hopping – The Page

Page 4: No Silverlight Application Is an Island of Richness

4

Reaching out to the browser

Page 5: No Silverlight Application Is an Island of Richness

Island Hopping – The Machine

Page 6: No Silverlight Application Is an Island of Richness

6

Reaching out to the machine

Page 7: No Silverlight Application Is an Island of Richness

Island Hopping – The Web

Page 8: No Silverlight Application Is an Island of Richness

Island Hopping – The Web

Implicit HTTP RequestsImplicit HTTP Requests

Explicit HTTP RequestsExplicit HTTP Requests

Web Service CallsWeb Service Calls

SocketsSocketsSite of Origin

Cross-Site

Cross-Site

TransportsTransports

SerializationSerialization

XML SerializerXML Serializer

HTTP(S) ( request/response )HTTP(S) ( request/response )

Protocols with Client Library SupportProtocols with Client Library Support

““SOAP”SOAP”SOAP 1.1 via SOAP 1.1 via

WCFWCF

““REST”REST”ADO.NET Data ADO.NET Data

ServicesServices

““Syndication”Syndication”RSS 2.0 & ATOM 1.0 via RSS 2.0 & ATOM 1.0 via

WCFWCF

Sockets ( duplex )Sockets ( duplex )

Uses

Page 9: No Silverlight Application Is an Island of Richness

Making Use of HTTP

We won’t focus on implicit access;

2 main classes for explicit access;

WebClient offers simple GET/POST. HttpWebRequest offers more control.

Browser API’s limit HTTP verbs ( GET, POST )

Page 10: No Silverlight Application Is an Island of Richness

10

Reaching out via HTTP

Page 11: No Silverlight Application Is an Island of Richness

SOAPy Web Services with WCF

Only basicHttpBinding is “in the box”SOAP 1.1, XML, HTTP(S)not WS-Security, WS-Trust etc.

Derived PollingDuplexHttpBinding for duplexUses WS-Make Connection for polling over HTTP

Programming modelFamiliar client side object modelFamiliar configuration file - loaded from the XAPFamiliar “Add Service Reference” tooling in Visual Studio

Support for ASMX web services via XmlSerializerLimited around some SOAP-controlling attributes

Page 12: No Silverlight Application Is an Island of Richness

12

Reaching out – SOAP

Page 13: No Silverlight Application Is an Island of Richness

RESTful Services & Syndication

ADO.NET Data ServicesRESTful services from .NET Framework V3.5 Sp1datasvcutil.exe tool to generate proxy classesTunnels PUT/DELETE via POST to avoid the browser API HTTP limitation

AJAX Services, RSS, ATOM and Other ServicesUse WebClient/HttpWebRequest Serialize/De-serialize data with;

XmlSerializer, DataContractSerializer, DataContractJsonSerializerSyndicationFeed, Rss20FeedFormatter, Atom10FeedFormatter

Page 14: No Silverlight Application Is an Island of Richness

14

Reaching out – REST & RSS

Page 15: No Silverlight Application Is an Island of Richness

Making Cross-Domain Requests

www.server1.com

Requests Page with SilverlightApplication

www.server2.com

App Requests Cross-Site Resourcehttp://www.server2.com/vroot/foo.xml

clientaccesspolicy.xml

Framework attempts to accesshttp://www.server2.com/ looking for

crossdomain.xml

Framework falls back to accesshttp://www.server2.com/ looking for

<access-policy> ... <grant-to /> ..</access-policy>

CheckCheckPolicyPolicy

Page 16: No Silverlight Application Is an Island of Richness

16

Reaching out across domains

Page 17: No Silverlight Application Is an Island of Richness

Making Cross-Scheme Requests

www.server1.com

Requests Page with SilverlightApplication over HTTP

App Requests Resource over HTTPS

Page 18: No Silverlight Application Is an Island of Richness

Communicating with Sockets

Client can connectClient cannot listen

ConnectConnectport 4502

Fixed port range4502 - 4534

Framework uses a well known port943 and sends an XML (UTF8) request fora client access policy

<policy-file-request/>

45045022

943943

<access-policy> ... <grant-to 4502/> ..</access-policy>

responseresponse

<access-policy> ... <grant-to 4502/> ..</access-policy>

CheckCheckPolicyPolicy

async, duplex commsasync, duplex comms

Page 19: No Silverlight Application Is an Island of Richness

19

Reaching out – Socket style

Page 20: No Silverlight Application Is an Island of Richness

Resources

www.silverlight.net

Page 21: No Silverlight Application Is an Island of Richness

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.