Networking and web services in silverlight
Download
1 / 34

- PowerPoint PPT Presentation


  • 153 Views
  • Updated On :

CL06. Networking and Web Services in Silverlight. Yavor Georgiev Program Manager Microsoft Corporation. Getting Data Into Silverlight. Message Pattern. Interaction Model. Resource centric. Multicast. Duplex. Operation centric. Request/reply.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about '' - iden


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Networking and web services in silverlight l.jpg

CL06

Networking and Web Services in Silverlight

YavorGeorgiev

Program Manager

Microsoft Corporation


Getting data into silverlight l.jpg
Getting Data Into Silverlight

Message Pattern

Interaction Model

Resourcecentric

Multicast

Duplex

Operationcentric

Request/reply


Data access examples l.jpg
Data Access Examples

  • “Forms over data” E2E business app

  • Access data from third-party REST service

  • Access your database or SharePoint data model using REST

  • App which accesses server business logic

  • Chat app

  • Streamed data (video, stock prices) inside an intranet


Resource centric apps l.jpg
Resource-Centric Apps

Message Pattern

Interaction Model

  • “Forms over data” E2E business app

Resourcecentric

Multicast

Duplex

Operationcentric

Request/reply


Wcf ria services system web domainservices l.jpg
WCF RIA ServicesSystem.Web.DomainServices

  • “Forms over data” E2E business app

    • Prescriptive model for CRUD services

    • Great tooling to maximize productivity

    • E2E data: sorting, paging, filtering, validation…

  • RIA Services now built on top of WCF

    • Productivity of RIA Services

    • Power and flexibility of WCF

  • To learn more tomorrow:

    • CL21 @ 11:30AM - Building Amazing Business Applications with Silverlight and .NET RIA Services

    • CL07 @ 1:45PM - Mastering .NET RIA Services


Resource centric apps6 l.jpg
Resource-Centric Apps

Message Pattern

Interaction Model

Resourcecentric

Multicast

Duplex

WCF RIA Services

Operationcentric

Request/reply



Resource centric apps8 l.jpg
Resource-Centric Apps

Message Pattern

Interaction Model

  • Access data from third-party REST service

  • Access your database or SharePoint data model using REST

Resourcecentric

Multicast

Duplex

Operationcentric

Request/reply


Accessing public rest services system net l.jpg
Accessing Public REST ServicesSystem.Net

  • ClientHttp networking stack

    • Integrated with the OS networking stack

    • Supports common BrowserHttp stack features for consistent experience

  • Better RESTful protocol support for same and cross-domain scenarios

    • All HTTP verbs supported

    • Response bodies available for all HTTP status codes

    • Authentication & cookies support


Clienthttp stack features l.jpg
ClientHttp Stack Features


Travel agent app11 l.jpg

Travel Agent App

demo

Accessing Public REST Services


Access a data model using rest system data services l.jpg
Access a Data Model Using RESTSystem.Data.Services

  • WCF Data Services

    • Formerly ADO.NET Data Services

    • Services with a RESTful interface and a set of conventions designed for easy data sharing

  • What is Data Services?

    • Server framework for .NET, others coming

    • Clients for Silverlight, .NET, PHP, Java, AJAX

    • SharePoint 2010 uses a Data Service to expose data


Data services client l.jpg
Data Services Client

  • Accessing Data Services

    • Silverlight ClientHttp stack still an option

    • Data Services client more usable as it knows the details of the data service interface

  • Features

    • Full abstraction on top of the service – no need to deal with HTTP, serialization, etc

    • Data as objects with automatic change tracking

    • LINQ for queries

    • Data-binding friendly interfaces

    • Work same-domain and cross-domain


Travel agent app14 l.jpg

Travel Agent App

demo

Accessing SharePoint Using aData Service


Aside windows communication foundation l.jpg
Aside: Windows Communication Foundation

Programming Model

Core Services

Web HTTP Services

Data Services

RIA Services

Workflow Services

Service Model

Data Contract

Service Contract

Service Behavior

Channel Model

Formats

(Atom, JSON, XML,…)

Transports

(HTTP, TCP, …)

Protocols

(SOAP, HTTP, OData)


Resource centric apps16 l.jpg
Resource-Centric Apps

Message Pattern

Interaction Model

Resourcecentric

Multicast

Duplex

System.Net

WCF Data Services

Operationcentric

Request/reply

  • Access data from third-party REST service

  • Access your database or SharePoint data model using REST


Operation centric apps l.jpg
Operation-Centric Apps

Message Pattern

Interaction Model

  • App which accesses server business logic

  • Chat app

  • Streamed data (video, stock prices) inside an intranet

Resourcecentric

Multicast

Duplex

Operationcentric

Request/reply


Operation centric apps with wcf system servicemodel l.jpg
Operation-Centric Apps with WCFSystem.ServiceModel

  • Accessing server business logic

    • Generated proxies (Add Service Reference)

    • Serialization of objects on the wire, faults

    • High-performance encoders

    • Different security approaches

  • Chat scenario

    • High-level messaging patterns built on top of networking APIs


Binary message encoder server throughput increase l.jpg
Binary Message EncoderServer throughput increase

24%

71%


Binary message encoder message size reduction l.jpg
Binary Message EncoderMessage size reduction


Wcf features l.jpg
WCF Features

  • Faults enabled

    • System.ServiceModel.CommunicationException was unhandled by user codeMessage="The remote server returned an error: NotFound."

    • To get full exceptions, use ClientHttp stack

  • Security in cross-domain scenarios enabled

    • Normally use browser-managed security (generally not safe for cross-domain use)

    • Transport security with message credentials in cross-domain scenarios


Duplex messaging server push l.jpg
Duplex Messaging (Server Push)

  • Server push is compelling when server has to notify client of events (email server)

    • Internet: PollingDuplex (HTTP-based)

      • [Post SL4 Beta] response chunking for better performance

      • [Post SL4 Beta] can scale across machines (web farms, Windows Azure) – Invensys case study

    • Intranet: NetTcp (TCP sockets-based)

      • Also works for request/reply services

  • Both offer the same programming model – just a matter of changing the binding


Duplex messaging scalability l.jpg
Duplex Messaging Scalability

Intel Xeon 2 [email protected], 2GB RAMWindows Server 2008 32-bit, IIS7


Travel agent app24 l.jpg

Travel Agent App

demo

Implementing Chat Using Duplex Messaging


Multicast messaging system net l.jpg
Multicast MessagingSystem.Net

  • UDP multicast is a technique for one-to-many communication over an IP infrastructure

  • Scenarios

    • Market data streaming

    • Video and media streaming

    • Real-time communication

    • Device and service discovery


Udp multicast details l.jpg
UDP Multicast Details

  • Scales to a large receiver population

  • Two key shapes for multicast groups:

    • Single Source Multicast (one-to-many)System.Net.Sockets.UdpSingleSourceMulticastClient

    • Any Source Multicast (many-to-many)System.Net.Sockets.UdpAnySourceMulticastClient

  • Need to expose a policy responder (just like sockets and HTTP)

    • [Post SL4 Beta] Going away for both sockets and multicast if app is elevated


Operation centric apps27 l.jpg
Operation-Centric Apps

Message Pattern

Interaction Model

  • App which accesses server business logic

  • Chat app

  • Streamed data (video, stock prices) inside an intranet

Resourcecentric

Multicast

Duplex

System.Net

Operationcentric

Request/reply

WCF

System.Net


Data access examples28 l.jpg
Data Access Examples

  • “Forms over data” E2E business app

    • WCF RIA Services (System.Web.DomainServices )

  • Access data from third-party REST service

    • System.Net

  • Access your database or SharePoint data model using REST

    • WCF Data Services (System.Data.Services)

  • App which accesses server business logic

    • WCF (System.ServiceModel)

  • Chat app

    • WCF (System.ServiceModel)

  • Streamed data (video, stock prices) inside an intranet

    • System.Net


Additional resources l.jpg
Additional Resources

  • Blogs:

    • http://blogs.msdn.com/astoriateam

    • http://blogs.msdn.com/matos

    • http://blogs.msdn.com/ncl

    • http://blogs.msdn.com/silverlightws(will have sample code from today)

  • E-mail: [email protected]


Related sessions l.jpg
Related Sessions

  • Today

    • FT12 - ADO.NET Data Services: What’s New with the RESTful Data Services Framework

    • FT55 - Developing REST Applications with the .NET Framework

    • SVC31 - Lessons Learned: Building On-Premises and Cloud Applications with the Service Bus and Windows Azure

  • Tomorrow

    • CL21 @ 11:30AM - Building Amazing Business Applications with Silverlight and.NET RIA Services

    • CL07 @ 1:45PM - Mastering .NET RIA Services

    • PR12 @ 1:45PM - It's All about the Services: Developing Custom Applications for SharePoint Server 2010 Using ASP.NET, WCF, and REST


Slide31 l.jpg

YOUR FEEDBACK IS IMPORTANT TO US!

Please fill out session evaluation forms online at

MicrosoftPDC.com


Learn more on channel 9 l.jpg
Learn More On Channel 9

  • Expand your PDC experience through Channel 9

  • Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses

    channel9.msdn.com/learn

Built by Developers for Developers….


ad