Visual Studio 2008 and Service Oriented...

23

Transcript of Visual Studio 2008 and Service Oriented...

Page 1: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All
Page 2: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Dave GloverDeveloper EvangelistMicrosoft Australia Pty LtdBlog: http://blogs.msdn.com/dglover

{Visual Studio 2008 and Service Oriented Development}

Page 3: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All
Page 4: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Windows Communication Foundation

Review

New support in .NET Framework 3.5 for

RESTful ServicesRepresentational State Transfer

Syndication

Page 5: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Visual Studio 2008 and .NET 3.5

provide seamless support for all

of the protocols and techniques

popular in Web 2.0-style

applications.

Visual Studio 2008 provides visual

designers, debugging and profiling

for WCF and WF.

Numerous project items for service

oriented architectures.

Services are often used to implement pattern-based behavior

and/or business rules.

Visual Studio 2008 provides integration between Windows

Workflow and Windows Communication Server.

Page 6: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

SOAP/WS-* and REST

Two approaches to Web services are in use today:SOAP and the WS-* specifications

More Enterprise/Business Process Focused

Representational State Transfer (REST)Amazon S3, Flickr, Facebook, Twitter

Plenty of debate between proponents of each approach

.NET Fx 3.5 and Windows Communication Foundation (WCF) support for both approaches

Microsoft is agnostic in this debate

Page 7: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Interopwith otherplatforms

ASMX

Attribute-Based

Programming

Enterprise

Services

WS-*ProtocolSupport

WSE

Message-Oriented

Programming

System.Messaging

ExtensibilityLocation

transparency

.NET

Remoting

Page 8: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Building your first WCF Project inVisual Studio 2008

WCF Test Harness

Page 9: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Illustrating the approach

POST /AccountAccess/Accounts.svc

Host: www.quickbank.com

SOAPAction: GetBalance

<soap:Envelope xmlns:soap= …

<soap:Body>

<GetBalance xmlns= …

<Account>2</Account>

</GetBalance>

</soap:Body>

</soap:Envelope>

WCF

Client

WCF

Service

Account 1

Account 2

Account 3

Page 10: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All
Page 11: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

An architectural style

Two core principles:

Everything accessed through a uniform interface

All data is identified with a URI

Principles for scalability on the Web

Be stateless

Be cacheable whenever possible

RESTful Web ServicesBy Leonard Richardson and Sam Ruby

Page 12: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

A closer look

Primarily POST, GET, PUT, and DELETE (≈ CRUD)

The semantics of GET are well-defined

The semantics of the others are more ambiguousAn example from the HTTP 1.1 spec:

POST is designed to allow a uniform method to cover the

following functions:

- Annotation of existing resources;

- Posting a message to a bulletin board, newsgroup,

mailing list, or similar group of articles;

- Providing a block of data, such as the result of

submitting a form, to a data-handling process;

- Extending a database through an append operation.

The actual function performed by the POST method is

determined by the server . . .

Page 13: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Illustrating the approach

WCF

Client

WCF

Service

GET www.quickbank.com/Accounts/2

Account 1

Account 2

Account 3

Page 14: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

WCF interface

[ServiceContract]

interface IAccount

{

[OperationContract]

[WebGet]

int GetBalance(string account);

[OperationContract]

[WebInvoke]

int UpdateBalance(string account,

int amount);

}

Sends request using HTTP

GET

Sends request using

HTTP POST (by default)

Page 16: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

A service for banking functions might include discrete operations such as:

GetBalance(Account)

UpdateBalance(Account, Amount)

GetPhoto(PhotoId)

These work well with either REST or SOAP

Suppose you needed to

Transfer Money or Book Travel

Co-ordinated Processes across multiple services Banks, Airlines, hotels, cars etcFits the process-oriented, broker distributed SOAP services

Page 17: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Protocol for invoking operations SOAP HTTP

Transport protocol HTTP, TCP, others HTTP

Language for describing

interfaces

WSDL No standard

Conveying security tokens WS-Security HTTP, SSL

Acquiring security tokens WS-Trust No standard

Establishing a security context WS-SecureConversation SSL

Providing end-to-end reliability WS-ReliableMessaging No standard

Supporting distributed ACID

transactions

WS-AtomicTransaction,

WS-Coordination

No standard

Defining policy WS-Policy, et al. No standard

Acquiring interface definitions WS-MetadataExchange No standard

A capability summary

SOAP/WS-* REST

Page 18: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

What is exposed?

REST Focused on accessing named data

The barrier to entry is lowRelies on HTTP and URLs no special libraries

Eg JavaScript, Python, Ruby

KISS Focus is simplicity

SOAP Focused on accessing named operations, each of which implements some logic

The barrier to entry is higherSOAP requires a SOAP stack, WSDL, and maybe implementations of the WS-* specs

Richer Application Services

Broad Standardisation

Page 19: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Syndication is very popular and an ideal way to spread the use of your applications.

WCF Syndication Services

Visual Studio 2008 provides a project template that

creates a syndication based WCF project. This project

type enables you to immediately expose a RSS or

ATOM based feed.

Page 21: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Visual Studio 2008 and .NET 3.5

provide seamless support for all

of the protocols and techniques

popular in Web 2.0-style

applications.

Visual Studio 2008 provides visual

designers, debugging and profiling

for WCF and WF.

Numerous project items for service

oriented architectures.

Services are often used to implement pattern-based behavior

and/or business rules.

Visual Studio 2008 provides integration between Windows

Workflow and Windows Communication Server.

Page 22: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

Install Visual Studio 2008

Download available for MSDN Subscribers

Download Starter kits, hands-on-labs and videos

http://download.vstudio/starterkits

Become familiar with WCF and WF

http://wcf.netfx3.com/

http://wf.netfx3.com/

User Group Communities Across Australia

http://msdn2.microsoft.com/en-au/cc185136.aspx

Page 23: Visual Studio 2008 and Service Oriented Developmentdownload.microsoft.com/documents/australia/heroes/... · Two core principles: Everything accessed through a uniform interface All

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