Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dec 7, 2007 Can you read this? If not, please sit closer. Thank you.

Similar presentations


Presentation on theme: "Dec 7, 2007 Can you read this? If not, please sit closer. Thank you."— Presentation transcript:

1 Dec 7, 2007 Can you read this? If not, please sit closer. Thank you.

2 Request doSomeWork 40 -12.53 Response 19980717T14:08:55 Something here XML RPC (1998)

3 <soap-env:envelope soap-env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">... 40 -12.53 <soap-env:Envelope soap-env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> 12345 Something here Early SOAP (2000) section 5 encoding

4 SOAP fancy encoding rules My Life and Work Henry Ford mailto:henryford@hotmail.com http://www.henryford.com References: Sparse arrays: Third row, third col Eighth row, third col

5 <soap-env:envelope soap-env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">... … your XML Schema compliant document goes here … Document/literal (2003): Forget all the fancy encoding rules

6 <soap-env:envelope soap-env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">... … XML Schema compliant value… … … XML Schema compliant value… … I want my, I want my RPC (rpc/literal) Namespace does not have to be the same as the parameter values Argument elements dont even have a namespace Lets you model procedure calls, but cant validate SOAP body with an XML Schema

7 SOAP encoding convention line-up circa 2003 1.RPC/encoded (the original) 2.Document/literal (based on XML Schema, but doesnt model RPC) 3.RPC/literal (adds RPC modeling, breaks XML Schema validation) Cant we model RPC without breaking Schema validation?

8 Wrapped document literal style (2005) <soap-env:envelope soap-env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">... … … Entire body complies with an XML Schema containing element doSomething containing a sequence of elements foo and bar

9 Handy summary SchemeRatingWhy? rpc/encoded (1998) BAD Because encoded means section 5 encoding and that hairy scheme has been displaced by XML Schemas doc/literal (2003) BEST Send an XML Schema compliant document, get one back. Awesome. rpc/literal (2003) BADFailed attempt to reconcile document style with RPC. wrapped/literal (2005) GOODSuccessful attempt to reconcile document style with RPC.

10 Web Service Definition Language (WSDL 1.1)... Wrapped style. Notice the operation has one message part called parameters which is an XML sequence of the args

11 WSDL IS IMPORTANT

12 Code first / WSDL first decision algorithm Will other projects be using these services? i.e. is this part of an SOA? Yes Write WSDL first. Think through interfaces carefully, plan for backward compatibility, write lots of comments, and maintain in source control. No Are you in a great hurry? Yes Write code first and use doc/literal style. i.e. Every method has one arg. Use annotations to name everything and review WSDL afterward. No Write code first in wrapped/literal style, i.e. Use annotations to name everything and review WSDL afterward.

13 Goodies WS-Security (message integrity, confidentiality, and authentication) WS-ReliableMessaging WS-Routing (messaging patterns and routes) WS-Eventing (pub/sub) Many other incomprehensible extensions, collectively referred to as WS-*

14 The SOAP way of thinking

15 In the meantime…

16 Will SOAP collapse under its own weight?

17 Complexity LowHigh SOAP REST ?

18 Comparison points WSDL is a good idea for both SOAP and REST (not a long-term differentiator) SOAP and REST both allow you to name resources with URIs (also not a long-term differentiator) REST adds value to the entire web (we dont care) REST is easier to program (not for long) SOAP provides better support for async messaging SOAP is better if developers and network administrators dont have a good relationship

19 In conclusion For enterprise apps, default to SOAP. But if (like Amazon.com) you are catering to people who are not making a large investment in connecting to your service have control over your network are trying to reach a broad audience … then go with REST. Expires: Mon, 31 Mar 2008 20:00:00 GMT

20 Questions?


Download ppt "Dec 7, 2007 Can you read this? If not, please sit closer. Thank you."

Similar presentations


Ads by Google