7. What is wrong with
SOAP?
Have to invent protocol (nouns,
verbs) for each “service”
Every service is different
BUT: you can generate stubs
Nice? or brittle?
Encourages RPC?
Is not Simple or about Objects
8. Many SOAP services end up doc-style
XML messaging
useless: eg MS Sharepoint “xs:any” as
payload !
9. What is right with
REST
Fixed well defined verbs: GET, PUT,
POST, DELETE, HEAD ...
Focus on resources (not services)
Different REST endpoints “feel
consistent”
Makes “service implementer” work
harder
15. Focus is on data
Not services
So not a drop in for SOAP/RPC
Sometimes people do XML/RPC (but is
not RESTful)
Sometimes that is cool
Can use XSDs for this
WADL is silly
24. Some more theory
GET, PUT, DELETE meant to be idempotent
POST is powerful (and easily abused)
Use HTTP standard headers
Accept (content)
ETags for cache control
Lots are in HTTP (frameworks help you
out)
27. Content negotiation
Simple theory:
Client sets Accept (with
preference)
Server (jax-rs) uses @Produces
Are other ways
Complex to hand-roll
28. Client side
No specific dependencies
Just a http client
Sometimes can generate stubs
but would need XSDs etc
RESTEasy has some tools
29.
30.
31. Web clients
Can use direct from ajax
Modulo support for PUT, DELETE
Or treat the web view tier as
“client” to RESTful api
32. HATEOAS
Hypermedia as the engine of
application state
Basically: use links when GET:
<link href=’/someotherresource’/>
Should only have one entry point
(URL) and rest discovered (via links
- hypermedia !)
Honour Accept header/media types