SOAP
description
Transcript of SOAP
![Page 1: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/1.jpg)
Université Libre de Bruxelles 1
SOAP
Quang Vinh PhamSimon De Baets
![Page 2: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/2.jpg)
2
PlanIntroductionStructure and SemanticsError HandlingProcessing ModelTransport ProtocolSOAP and Web Services
Université Libre de Bruxlles
![Page 3: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/3.jpg)
Université Libre de Bruxelles 3
What’s SOAP ?
NOT THIS !
![Page 4: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/4.jpg)
Université Libre de Bruxelles 4
Introduction : Definition
Simple Object Access Protocol (SOAP)
Lightweight wire protocol for exchanging structured information over computer networks.
![Page 5: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/5.jpg)
Université Libre de Bruxelles 5
Introduction : ServiceAllows multiplaform exchange,
interoperability.
Loosely coupledVery scalable (use of HTTP)Allows asymmetrical communication
◦Client-server◦Applications can be implemented under
different models
![Page 6: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/6.jpg)
Université Libre de Bruxelles 6
Introduction : Evolution
1998 : ◦Creation by Winer, Box, Akthinson
and Al-Ghosein for Microsoft.◦Orignally Object Access Protocol.
2003 : v1.2.◦W3C recommandation.
![Page 7: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/7.jpg)
Université Libre de Bruxelles 7
Structure
![Page 8: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/8.jpg)
Université Libre de Bruxelles 8
Semantics : Envelope
Specify : ◦Namespace ◦Encodingstyle : Set of rules that
describes how data can be serialized to xml.
![Page 9: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/9.jpg)
Université Libre de Bruxelles 9
Semantics : Envelope
![Page 10: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/10.jpg)
Université Libre de Bruxelles 10
Semantics : HeaderImmediate child of envelope.The Header element information
item has:◦A local name of Header .◦A namespace name of
"http://www.w3.org/2003/05/soap-envelope".
◦Zero or more namespace qualified attribute information items in its attributes property.
◦Zero or more namespace qualified element information items in its children property.
![Page 11: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/11.jpg)
Université Libre de Bruxelles 11
Semantics : Header BlocksChild of header.Each SOAP header block element
information item:◦MUST have a namespace name
property which has a value.◦MAY have any number of character
information item children.◦MAY have any number of element
information item children.
![Page 12: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/12.jpg)
Université Libre de Bruxelles 12
Semantics : Header BlocksEach SOAP header block element
information item:◦MAY have zero or more attribute
information items in its attributes property : encodingStyle role mustUnderstand relay
![Page 13: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/13.jpg)
Université Libre de Bruxelles 13
Semantics :Header
![Page 14: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/14.jpg)
Université Libre de Bruxelles 14
Semantics : BodyArea where the data are stored.
Format change with the chosen communication model.
![Page 15: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/15.jpg)
Université Libre de Bruxelles 15
Semantics : BodyThe Body element information item has:
◦A local name of Body .◦A namespace name of
"http://www.w3.org/2003/05/soap-envelope".
◦Zero or more namespace qualified attribute information items in its attributes property.
◦Zero or more namespace qualified element information items in its children property.
![Page 16: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/16.jpg)
Université Libre de Bruxelles 17
Semantics : Body
![Page 17: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/17.jpg)
Université Libre de Bruxelles 18
An Example : Travel Reservation
![Page 18: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/18.jpg)
Université Libre de Bruxelles 19
An Example : Travel Reservation
![Page 19: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/19.jpg)
Université Libre de Bruxelles 20
Error Handling
SOAP provides some model to manage errors.
This information is located in the body
![Page 20: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/20.jpg)
Université Libre de Bruxelles 21
Error HandlingAll the iformations is contained in
the <env: fault> element.<env:fault>
◦<env:code>◦<env:reason>◦<env:Detail> (optional)◦<env:Node> (optional)◦<env:Role> (optional)
![Page 21: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/21.jpg)
Université Libre de Bruxelles 22
Error Handling
![Page 22: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/22.jpg)
Université Libre de Bruxelles 23
Processing Model
Goal : send a SOAP information since the SOAP sender to the SOAP reciever.
![Page 23: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/23.jpg)
Université Libre de Bruxelles 24
Procesing ModelSOAP Message Path for validating
purchase order.
Customer Node
Purchasing service node
Signature validation
node
1) Submit digitally signed purchase order
2) Validate digital signature
3) Process purchase order
![Page 24: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/24.jpg)
Université Libre de Bruxelles 25
Processing Model
SOAP attributes for processing Model◦Role (none, next, ultimateReceiver)◦mustUnderstand◦relay
![Page 25: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/25.jpg)
Université Libre de Bruxelles 26
Processing Model
![Page 26: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/26.jpg)
Université Libre de Bruxelles 27
Transport protocolSOAP purpose
◦exchanging data over networks◦binding mechanism between two
endpointsSOAP message = XML documentCarried by network protocol
◦HTTP, SMTP, FTP, MSMQ, …Network protocol does not affect
the design of SOAP message
![Page 27: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/27.jpg)
Université Libre de Bruxelles 28
Transport protocolPurpose : communication
between two endpointsSOAP node requirement
◦Construct and parse SOAP messages◦Communication over the network
![Page 28: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/28.jpg)
Université Libre de Bruxelles 29
Transport protocol : HTTPMost commonly usedNatural transport protocol for SOAPHTTP GET : retrieval of resource
◦Request : plain HTTP GET◦Response : SOAP message in body
HTTP POST : modification of resource◦Request / response : SOAP message in
bodyOne-way message or
request/response over HTTP
![Page 29: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/29.jpg)
Université Libre de Bruxelles 32
HTTP SOAP GET request
![Page 30: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/30.jpg)
Université Libre de Bruxelles 33
HTTP SOAP GET response
![Page 31: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/31.jpg)
Université Libre de Bruxelles 34
HTTP SOAP GET request
![Page 32: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/32.jpg)
Université Libre de Bruxelles 35
Transport protocol : SMTP
Advantage : store and forwardSuitable for partially connected
nodes, one way notifications, …SOAP payload contained in a
MIME message
![Page 33: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/33.jpg)
Université Libre de Bruxelles 36
Communication modelTwo ways to address a Web
service◦RPC◦Document
Affect the design of the SOAP message
![Page 34: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/34.jpg)
Université Libre de Bruxelles 37
SOAP and RPCRPC : remote procedure callWeb service : remote objectClient’s request : method call
with argumentsServer’s response : return result
![Page 35: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/35.jpg)
Université Libre de Bruxelles 38
SOAP and RPCSOAP message (RPC request)
◦URI for remote object to be called◦Method name as a structure◦Input parameters as fields in the
structure◦Name and order are crucial
Response◦Return value◦Output parameters
XML representation of a system structure
![Page 36: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/36.jpg)
Université Libre de Bruxelles 39
SOAP and RPC
![Page 37: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/37.jpg)
Université Libre de Bruxelles 40
SOAP and RPCAutomatic
serialization/deserializationTightly coupledSynchronousCan expose traditional
components as Web services◦Servlet◦Stateless session bean◦Java RMI object◦…
![Page 38: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/38.jpg)
Université Libre de Bruxelles 41
SOAP and message-style WSAny kind of XML dataNo restriction on the contentsMessage driven
◦Client sends entire document◦Web service processes document◦WS may or may not return a
responseAsynchronous communicationNo automatic
serialization/deserialization
![Page 39: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/39.jpg)
Université Libre de Bruxelles 42
SOAP and message-style WSSOAP message
◦Body : XML document fragment◦Body : reflect no explicit XML
structure
![Page 40: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/40.jpg)
Université Libre de Bruxelles 43
Document-style
![Page 41: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/41.jpg)
Université Libre de Bruxelles 44
SOAP vs REST
Remind REST : 4 keys concepts :
◦Ressources◦Ressource names (URI’s)◦Ressource representation◦Links between ressource
![Page 42: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/42.jpg)
Université Libre de Bruxelles 45
SOAP vs REST
And 4 key properties : ◦Addressability◦Statelessness◦Connectedness◦The Uniform Interface
![Page 43: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/43.jpg)
Université Libre de Bruxelles 46
SOAP vs RESTDoes SOAP support the REST-
based style ?◦Ressources◦URI’s◦Ressource representation◦Links between ressource◦Addressability◦Statelessness◦Connectedness◦The Uniform Interface
![Page 44: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/44.jpg)
Université Libre de Bruxelles 47
ReferencesM. P. Papazoglou, Web Services:
Principles and Technology, chapter 4, pages 119-145.
http://www.w3.org/TR/soap12-part0/.
http://msdn.microsoft.com/en-us/library/ms995800.aspx
![Page 45: SOAP](https://reader035.fdocuments.us/reader035/viewer/2022062520/5681637d550346895dd45c26/html5/thumbnails/45.jpg)
Université Libre de Bruxelles 48
QUESTIONS