soap, rest, pox, rss – the what's what of services aaron skonnard co-founder, pluralsight

33

Upload: ronnie-mixon

Post on 28-Mar-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight
Page 2: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

SOAP, REST, POX, RSS – SOAP, REST, POX, RSS – The What's What of The What's What of ServicesServices

Aaron SkonnardAaron SkonnardCo-Founder, PluralsightCo-Founder, Pluralsighthttp://pluralsight.com/aaron http://pluralsight.com/aaron

Page 3: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Outline

Story of My First Service

The Origins of XML

The Origins of Services

SOAP vs. REST

Trade-offs & Guidance

Page 4: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Story of My First Service

Our Application

ASCEND 97

Partner Systems

Page 5: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

1997 Implementation

Our Application

ASCEND 97

Partner Systems

HTTP

[Distributor]Name=Dave JonesID=1234-1000...[Distributor]Name=Sara JonesID=1234-1001Sponsor=1234-1000...

Text-based data format,easier than binary

SpecsSpecifications defined

message types

Specs

Specs

Message parsing

became the most difficult

aspect

Page 6: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Architecture Fundamentals

Message-based architectureCommunication transportData format

Standard message typesDefined in a specification

Extensibility

Page 7: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

1998: A Big Turning Point

XML, an innocuous new technology, hit the scenes in 1998

Offered a "standard" data formatBased on a simplification of SGMLQuickly noticed and embraced

Promised to simplify scenarios like mine

Page 8: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

The Origins of XML

Today

1967

1969

1980

1986

1989

1993

1994

1996

1998

Tunnicliffe and Rice introduce the concept of generic markup

Goldfarb, Mosher, and Rice invented GML (IBM)

First ANSI Standard Generalized Markup Language (SGML) draft released

SGML approved as ISO standard (ISO 8879)

Tim Berners-Lee invented HTML at CERN, calls it the World Wide Web

CERN declares WWW free-to-all, NCSA releases Mosaic browser

TBL forms the W3C with MIT and CERN

XML proposed to W3C as a simplification of SGML, led by Jon Bosak (Sun)

XML approved as W3C Recommendation

XML ubiquitous throughout the industry

Page 9: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

What Made XML Successful?

The format wasn't better, so what gives?

The success of HTML made it familiarNot very many people involvedThey produced a simple specificationDidn't require huge investments

Simplicity allowed anyone to get involved

Page 10: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Simple XML Foundation

XML

XPath XSLT APIs

Namespaces

Key XML technologies quickly developed

Laid solid foundation for apps to build onSimplified numerous business scenarios

Infoset

Page 11: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Angle Bracket Factions

Once XML was commonplace, the factions became apparent

XML

Document-Centric

Data-Centric

Focused on document-based systems, electronic publishing, etc.

Focused on data structures, services, distributed application scenarios, etc.

Page 12: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

On Defining Standards

The Web has shown ubiquity is king

Defining standards is tricky businessRequires collaboration and consensusForces everyone to compromiseThe more people, the harder it becomesUsually takes a long time

"Only a committee can make a decision that's dumber than any of its

members."

Page 13: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

The Origins of Services

Today

4/2000 SOAP 1.1 released on vendor Web sites

SOAP 1.1 / 1.2 ubiquitous throughout the industry

1998 Work on SOAP commenced, first spec never published

2/1999 SOAP 1.0 released as an IETF Internet Draft

5/2000 SOAP submitted to the W3C as Note, work on SOAP 1.2 begins

2/2001 ebXML integrates SOAP into Messaging Services Specification

10/2003 Tenets of Service Orientation introduced at PDC

3/2001 WSDL 1.1 released as W3C Note

4/1998 Userland releases XML-RPC (subset of original SOAP work)

2000 REST architecture published by Roy Fielding

2/2005 POX enters the lexicon

6/2003 SOAP 1.2 released as W3C recommendation

Page 14: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

SOAP Architecture

SOAP is an extensible XML framework

SOAP defines:A standard XML framing mechanism that can be used with any transport A standard representation for errorsA standard processing model

SOAP itself doesn't define:A standard metadata (type) system

Page 15: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

SOAP Framing

SOAP framing allows future extensibility

Headers pushed into XML to decouple functionality from transport

<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"> <soap:Header>

</soap:Header> <soap:Body>

</soap:Body></soap:Envelope>

<!-- headers go here -->

<!-- payload go here -->

Headers define additional layers (WS-*)

Page 16: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

XSD and WSDL

SOAP was completed by XSD and WSDL

XML Schema (XSD) introduced type system for XML applicationsWSDL introduced an interface definition language for services

WS-I sanctioned them in the basic profile

Basic Profile 1.1 released 8/2004

Page 17: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

SOAP/WSDL Frameworks

Tool support simplifies the dev experience

Code generation built on XSD and WSDL Move between XML and native type systemsHides virtually all XML/HTTP coding detailsadwords = makeProxy(

‘http://.../KeywordService’, ‘nelson’, ‘ossifrage’)adwords.setKeywordMaxCpc(53834, ‘flowers’, $0.05)

This tool support is one of SOAP's key advantages

Page 18: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

MessagingMessaging

XMLXML

TransportsTransports

SecuritySecurity ReliableReliableDeliveryDelivery

TransactionsTransactions

Metadata

Metadata

WS-* protocol stackMessage Security

Secure ConversationTrust

Security Policy

CoordinationAtomic TransactionsBusiness ActivitiesReliable Messaging

CoordinationAtomic TransactionsBusiness ActivitiesReliable Messaging

XML SchemaWSDLPolicy

DiscoveryDiscovery

HTTPTCP

Cross-AppDomain

SOAPAddressing

EventingTransfer

XML InfosetXML

MTOMBinary

Page 19: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

WCF (WinFX)

Microsoft's WCF provides full WS-* support

SOAP-based security, RM, and transactionsSupports numerous transports (HTTP, TCP, named pipes, MSMQ, P2P, etc)

Hides complexity through simplified OM

Page 20: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

SO Design Principles

Service Orientation (SO) emerged to help us think about service design

SO is a set of design principles:Boundaries are explicitServices are autonomousShare schema and contract onlyPolicy-based compatibility

Page 21: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Orchestration (Workflow)

A future trend is orchestration / workflow

Automating business processes that consist of XML message exchanges

BPEL is the standard laying the foundation

Based on XML, XSD, and WSDL foundationSupported by MS, IBM, BEA, etc

See BizTalk and WF (WinFX) for support

Page 22: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Is SOAP Too Much?

Some believe SOAP is overkill at times

When the Basic Profile is enoughNo need for SOAP-based SRT

Plain Old SOAP approach often usedLeverage SOAP but without WS-*Increases interoperability potentialFrameworks/tools hide XML/HTTP code

Page 23: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Plain Old XML (POX)

Some go further: Plain Old XML (POX)Ditch SOAP altogetherJust exchange XML messages over HTTP

Interoperability is virtually guaranteed

Requires more XML/HTTP coding

Page 24: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

REST Architectures

In 2000, Roy Fielding introduced REST

"REpresentational State Transfer"

An architecture for services on the Web

An observation of how the Web worksFundamentally different from SOAP/WS-*, but similar goals in mind

Page 25: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

REST Design Principles

REST design principles:Stateless client/server protocol (HTTP)Well-defined operations (GET, POST, PUT, DELETE)Universal resource identifier syntax (URI)Use of hypermedia (HTML, XML)

Page 26: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Understanding REST

SOAP emphasizes verbs while REST emphasizes nouns

getUser()addUser()removeUser()updateUser()listUsers()findUser()

getLocation()addLocation()...

User { }Location { }

SOAPREST

<user> <name>Jane User</name> <gender>female</gender> <location href="http://www.example.org/locations/us/ny/new_york_city">New York City, NY, US</location></user>

POX representation

Generic HTTP verbs can be used with each noun (GET, POST, PUT, DELETE)

Tunnels through HTTP POST

Page 27: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Weblogs and RSS

Most of blogosphere is REST-basedEach item is addressable by URIYou can retrieve lists of items, etc

RSS versions define representationsRSS 0.9x, 1.0 and 2.0 are common today Very different, influenced by vendors

Page 28: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Atom 1.0

Atom 1.0 is emerging as the syndication standard today

Submitted to IETF, published as RFC 4287Completely vendor-neutral

Atom Publishing API is REST-based

Page 29: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

REST Pros & Cons

ProsSimplifies traditional CRUD-style scenariosAddressability, consistency Optimized for reads (GET)

ConsTied to HTTP for all practical purposesHence, limited to HTTP feature setLacks metadata standards & tool support

Page 30: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

SOAP/REST Sightings

Both have carved out their own turf

Many popular sites offer services via SOAP or REST or both

Google, Yahoo!, Amazon, eBay, etcThe jury is still out in certain areas

Enterprises are embracing SOAP/WS-*

Complexity exposes REST limitations

Page 31: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Guidance

Embrace POX/HTTP for reach integration

Use Plain Old SOAP for better tool supportConsider REST principles for CRUD-driven scenarios (may extend reach further)

Leverage SOAP + WS-* for deep enterprise integration

WSE, WCF, BizTalk, WF, etc.

Page 32: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

© 2005 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Page 33: SOAP, REST, POX, RSS – The What's What of Services Aaron Skonnard Co-Founder, Pluralsight

Special training offer from PluralsightMention you attended this talk, and receive a $200 discount on your next course

Upcoming courses.NET Campsight, Building Connected Systems

September 18-22 in Redmond, WA

Double Feature: WCF & WorkflowAugust 28-September 1 in Mountain View, CA