Upload
hans-granqvist
View
304
Download
6
Tags:
Embed Size (px)
DESCRIPTION
Found this while SOAP vs REST deck while cleaning out an old hard drive...
Citation preview
Application DevelopmentWeb Services Episode IV: A New Hope
Hans GranqvistSr. Engineer, VIS
Application DevelopmentWeb Services Episode IV: A New Hope
Hans GranqvistSr. Engineer, VIS
Web services, def.
•Machine-to-machine•XML
– Messaging, encoding•“Service”
– Describe, discover, use•Interoperable
Example XML-RPC POST /RPC2 HTTP/1.0
User-Agent: Curl/5.1.2 (Windows)Host: example.orgContent-Type: text/xmlContent-length: 162
<?xml version="1.0"?><methodCall> <methodName>example.getStateName</methodName> <params> <param><value><i4>41</i4></value></param> </params></methodCall>
SOAP
•Abstract messaging framework– HTTP– Data types– Recipients– Rules & controls– Infinitely customizable
SOAP
•Content– Envelope = (Headers, Body)
•Encoding– Section 5 or literal
•Structure– RPC or Document-centric
Example SOAP <SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://www.w3.org/2003/05/soap-envelope"xmlns:xsd="http://www.w3.org/1999/XMLSchema"xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">� <SOAP-ENV:Header> . . . Meta data . . . Optional data . . . </SOAP-ENV:Header> <SOAP-ENV:Body> <w:stateName xmlns:m="http://example.com/"> <num xsi:type="xsd:int">41</num> </m:stateName> </SOAP-ENV:Body></SOAP-ENV:Envelope>
• WSDL, UDDI, MTOM, BPEL4WS, WS-CDL,ASAP, WSRP
• WS-– Policy, Metadataexchange,
Reliability, PolicyAttachement,ReliableMessaging, Addressing,MessageDelivery, Notification,Enumeration, Trust, Coordination,SecurityPolicy, Transfer, CAF,Federation, SecureConversation,Eventing, Transactions, Security,Provisioning, Manageability, …
• OASIS, W3C, WS-I, IETF• IBM, BEA, TIBCO, Microsoft, Sun, SAP,
Oracle, VeriSign
•Not software, nor a specification
– Selection of ideals
– Best practices
•Not magic!
•The Web = REST
REST
2. Representations
• XML/HTML/JPG/ . . .• Interconnected, traversable
<?xml version="1.0"?><certificate> <id>04224</id> . . . <owner xlink:href= "http://verisign.com/owner/1701-A"/> </owner></certificate>
4. HTTP
• Application protocol• PUT, GET, POST, DELETE
– Create, Retrieve, Update, Delete• Use of headers fundamental
– Accept, Content-type . . . and many more
Accept: text/*; text/html -->
<-- Content-Type: text/xml
POST /test HTTP/1.1Host: http://verisign.comContent-Type: text/xmlContent-length: . . .
<message> . . . </message>
Headers
Content
Description & Discovery
• UDDI R.I.P.– January 12, 2006:
IBM, SAP, MSFT kill public UDDI server• WSDL 2.0
SOAP vs. REST
• Completeness vs. Toy-like• Pragmatism vs. Hippie ideology
or
• Bloated vs. Agile• Complexity vs. Simplicity• Web 1.0 vs. Web 2.0
Conclusion
•Both SOAP and REST needed– Simplicity rules
•Consider REST– Side-effects
•Consider security issues•WS-* momentum•Fight the good fight!