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

Post on 28-Mar-2015

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

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

Outline

Story of My First Service

The Origins of XML

The Origins of Services

SOAP vs. REST

Trade-offs & Guidance

Story of My First Service

Our Application

ASCEND 97

Partner Systems

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

Architecture Fundamentals

Message-based architectureCommunication transportData format

Standard message typesDefined in a specification

Extensibility

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

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

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

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

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.

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

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

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

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-*)

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

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

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

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

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

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

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

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

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

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)

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

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

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

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

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

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.

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

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

top related