Cleanser versus REST.


29 views
Uploaded on:
Description
cleanser env:encodingStyle=
Transcripts
Slide 1

Dec 7, 2007 SOAP versus REST Can you read this? If not, please sit nearer. Much obliged to you.

Slide 2

XML RPC (1998) Request <?xml version="1.0"?> < methodCall > < methodName > doSomeWork </methodName > < params > < param > <value>< int >40</int ></value> </param > < param > <value><double>- 12.53</double></value> </param > </params > </methodCall > Response <?xml version="1.0"?> < methodResponse > < params > < param > <value> <array> <data> <value><dateTime.iso8601>19980717T14:08:55</dateTime.iso8601></value> <value><string>Something here</string></value> </data> </array> </value> </param > </params > </methodResponse >

Slide 3

Early SOAP (2000) "segment 5 encoding" <?xml version="1.0"?> <soap-env:envelope cleanser env:encodingStyle="http://schemas.xmlsoap.org/cleanser/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/cleanser/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/cleanser/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <soap-env:header> ... </cleanser env:header> <soap-env:body> <m:doSomeWork xmlns:m="http://www.lab49.com/"> <foo xsi:type="xsd:int">40</foo> <bar>- 12.53</bar> </m:doSomeWork> </cleanser env:body> </cleanser env:envelope> <?xml version="1.0"?> <soap-env:Envelope cleanser env:encodingStyle="http://schemas.xmlsoap.org/cleanser/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/cleanser/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/cleanser/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <soap-env:body> <m:doSomeWorkResponse xmlns:m="http://www.lab49.com/"> <soap-enc:array cleanser enc:arrayType="xsd:ur-type[2]"> <baz xsi:type="xsd:int">12345</baz> <quux xsi:type="xsd:string">Something here</quux> </cleanser enc:array> </m:doSomeWorkResponse> </cleanser env:Body> </cleanser env:Envelope>

Slide 4

SOAP extravagant encoding rules References: <e:Book> <title>My Life and Work</title> <author href="#Person-1"/> </e:Book> <e:Person id="Person-1"> <name>Henry Ford</name> <address href="#Address-2"/> </e:Person> <e:Address id="Address-2">  <email>mailto:henryford@hotmail.com</email> <web>http://www.henryford.com</web> </e:Address> Sparse exhibits: <SOAP-ENC:Array SOAP-ENC:arrayType="xsd:string[,][4]"> <SOAP-ENC:Array href="#array-1" SOAP-ENC:position="[2]"/> </SOAP-ENC:Array> <SOAP-ENC:Array id="array-1" SOAP-ENC:arrayType="xsd:string[10,10]"> <item SOAP-ENC:position="[2,2]">Third column, third col</item> <item SOAP-ENC:position="[7,2]">Eighth line, third col</item> </SOAP-ENC:Array>

Slide 5

Document/exacting (2003): Forget all the extravagant encoding rules <?xml version="1.0"?> <soap-env:envelope cleanser env:encodingStyle="http://schemas.xmlsoap.org/cleanser/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/cleanser/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <soap-env:header> ... </cleanser env:header> <soap-env:body> … your XML Schema consistent report goes here … </cleanser env:body> </cleanser env:envelope>

Slide 6

I need my, I need my (rpc/exacting) <?xml version="1.0"?> <soap-env:envelope cleanser env:encodingStyle="http://schemas.xmlsoap.org/cleanser/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/cleanser/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/cleanser/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <soap-env:header> ... </cleanser env:header> <soap-env:body> <m:doSomething xmlns:m="http://lab49.com/"> <foo> … XML Schema consistent worth… … XML Schema agreeable quality… … </foo> <bar> … XML Schema agreeable quality… … </bar> </m:doSomething> </cleanser env:body> </cleanser env:envelope> Namespace does not need to be the same as the parameter values Argument components don\'t have a namespace Lets you show methodology calls, however can\'t accept SOAP body with a XML Schema

Slide 7

SOAP encoding tradition line-up around 2003 RPC/encoded (the first) Document/strict (in view of XML Schema, yet doesn\'t demonstrate RPC) RPC/exacting (includes RPC displaying, breaks XML Schema approval) Can\'t we display RPC without breaking Schema approval?

Slide 8

Wrapped archive strict style (2005) <?xml version="1.0"?> <soap-env:envelope cleanser env:encodingStyle="http://schemas.xmlsoap.org/cleanser/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/cleanser/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/cleanser/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <soap-env:header> ... </cleanser env:header> <soap-env:body> <m:doSomething xmlns:m="http://lab49.com/"> <m:foo> … </m:foo> <m:bar> … </m:bar> </m:doSomething> </cleanser env:body> </cleanser env:envelope> Entire body consents to a XML Schema containing component doSomething containing an arrangement of components foo and bar

Slide 9

Handy rundown

Slide 10

Web Service Definition Language (WSDL 1.1) <definitions> <types> <schema> <element name=" doSomething "> < complexType > <sequence> <element name=" foo " nillable ="true" type="string"/> <element name="bar" nillable ="true" type="double"/> </sequence> </complexType > </element> <element name=" doSomethingResponse "> ... </element> </schema> </types> <message name=" doSomethingRequest "> <part name="parameters" element=" doSomething "></part> </message> <message name=" doSomethingResponse "> <part name="parameters" element=" doSomethingResponse "></part> </message> < portType name=" myServices "> <operation name=" doSomething "> <input name=" doSomethingRequest " message=" doSomethingRequest "></input> <output name=" doSomethingResponse " message=" doSomethingResponse "></output> </operation> </portType > <binding name=" myServicesHttpBinding " type=" myServices "> <binding style="document" transport="http://schemas.xmlsoap.org/cleanser/http"/> <operation name=" doSomething "> <operation soapAction =""/> <input name=" doSomethingRequest "> <body use="literal"/> </input> <output name=" doSomethingResponse "> <body use="literal"/> </output> </operation> </binding> <service name=" myServices "> <port name=" myServicesHttpPort " binding=" myServicesHttpBinding "> <address location="http://..."/> </port> </service> </definitions> Wrapped style . Notice the operation has one message part called "parameters" which is a XML arrangement of the args

Slide 11

WSDL IS IMPORTANT

Slide 12

Code first/WSDL first choice calculation Write code first and use doc/exacting style. i.e. Each strategy has one arg. Use explanations to name everything and audit WSDL subsequently. Will different undertakings be utilizing these administrations? i.e. it is safe to say that this is a piece of a SOA? Is it true that you are in an incredible rush? No Yes Write code first in wrapped/exacting style, i.e. Use comments to name everything and survey WSDL a while later. Compose WSDL first. Thoroughly consider interfaces painstakingly, get ready for in reverse similarity, compose loads of remarks, and keep up in source control.

Slide 13

Goodies WS-Security (message respectability, classification, and verification) WS-ReliableMessaging WS-Routing (informing examples and courses) WS-Eventing (bar/sub) Many other unfathomable expansions, on the whole alluded to as WS-*

Slide 14

The SOAP state of mind

Slide 15

In the interim…

Slide 16

Will SOAP breakdown under its own weight?

Slide 17

Complexity Low High SOAP ? REST

Slide 18

Comparison focuses WSDL is a smart thought for both SOAP and REST (not a long haul differentiator) SOAP and REST both permit you to name assets with URIs (likewise not a long haul differentiator) REST increases the value of the whole web (we couldn\'t care less) REST is less demanding to program (not for long) SOAP gives better backing to async informing SOAP is better if engineers and system overseers don\'t have a decent relationship

Slide 19

In conclusion F

Recommended
View more...