2 no silverlight (2) application is an island (of richness) mike taulty microsoft uk...

24

Post on 19-Dec-2015

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com
Page 2: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

2

No Silverlight (2) Application is an Island (of richness)Mike TaultyMicrosoft [email protected] http://www.mtaulty.com

Page 3: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

3

The Silverlight Island

HTML

Silverlight

Page 4: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

4

Island Hopping – The Page

Silverlight

Page 5: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

5

Reaching out to the browser

Demo

Page 6: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

6

Island Hopping – The Machine

Silverlight

Page 7: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

7

Reaching out to the machine

Demo

Page 8: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

8

Island Hopping – The Web

Page 9: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

9

Island Hopping – The Web

Implicit HTTP Requests

Explicit HTTP Requests

Web Service Calls

Sockets Site of Origin

Cross-Site

Cross-Site

Asyn

chro

nous

API

’s

Transports

SerializationWCF DataContractXML JSON

XML Serializer

HTTP(S) ( request/response )

Protocols with Client Library Support“SOAP”

SOAP 1.1 via WCF

“REST”ADO.NET Data

Services

“Syndication”RSS 2.0 & ATOM 1.0 via

WCF

Sockets ( duplex )

Uses

Page 10: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

10

Making Use of HTTPWe 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 to GET/POST

Page 11: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

11

Reaching out with HTTP

Demo

Page 12: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

12

SOAPy Web Services with WCFOnly basicHttpBinding is “in the box”– SOAP 1.1, XML, HTTP(S)– not WS-Security, WS-Trust etc.

Derived PollingDuplexHttpBinding for duplex– Uses WS-Make Connection for polling over HTTP

Familiar Programming model– Client side object model– Configuration file - loaded from the XAP– “Add Service Reference” tooling in Visual Studio

Support for ASMX web services via XmlSerializer– Limited around some SOAP-controlling attributes

Page 13: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

13

Reaching out with SOAP

Demo

Page 14: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

14

RESTful Services & SyndicationADO.NET Data Services– RESTful services from .NET Framework V3.5 Sp1– Tunnels PUT/DELETE via POST to avoid the browser API HTTP

limitationAJAX Services, RSS, ATOM and Other Services– Use WebClient/HttpWebRequest – Serialize/De-serialize data with;

– XmlSerializer, DataContractSerializer, DataContractJsonSerializer– SyndicationFeed, Rss20FeedFormatter, Atom10FeedFormatter

Page 15: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

15

Reaching out with REST, RSS

Demo

Page 16: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

16

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>

CheckPolicy

Page 17: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

17

Reaching out cross-domain

Demo

Page 18: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

18

Making Cross-Scheme Requests

Requests Page with SilverlightApplication over HTTP

App Requests Resource over HTTPS

www.server1.com

Page 19: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

19

Communicating with Sockets

Client can connectClient cannot listen

Connectport 4502

Fixed port range4502 - 4534

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

<policy-file-request/>

4502

943

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

response

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

CheckPolicy

async, duplex comms

Page 20: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

20

Reaching out with sockets

Demo

Page 21: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

21

No Silverlight Application is an Island

Silverlight

Page 22: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

22

Resources

www.silverlight.net

Page 23: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

23

Resources

www.microsoft.com/teched Tech·Talks Tech·Ed BloggersLive Simulcasts Virtual Labs

http://microsoft.com/expression http://msdn.microsoft.com

Developer’s Kit, Licenses, and MORE!

Page 24: 2 No Silverlight (2) Application is an Island (of richness) Mike Taulty Microsoft UK Mike.Taulty@microsoft.com

24

© 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.