SOAP
-
Upload
ceallach-argue -
Category
Documents
-
view
39 -
download
0
description
Transcript of SOAP
![Page 1: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/1.jpg)
SOAP
Simple Object Access Protocolby Vinubalaji Gopal (Vinu)
![Page 2: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/2.jpg)
What is SOAP?
W3C Recommendation Simple Object Access Protocol XML based Can use SMTP or HTTP transport Can be used for RPC or Message exchange Works through Firewall Platform Independent
![Page 3: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/3.jpg)
SOAP Participants
![Page 4: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/4.jpg)
SOAP Message
<?xml version='1.0' ?><env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header> .... </env:Header> <env:Body> ..... </env:Body></env:Envelope>
![Page 5: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/5.jpg)
SOAP Message
Header isOptional meantfor SOAP Intermediary
![Page 6: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/6.jpg)
SOAP Message Example
SOAP Sender
<?xml version='1.0' ?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Body> <flight xmlns:env=”urns”> list </flight> </env:Body></env:Envelope>
SOAP Receiver
![Page 7: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/7.jpg)
SOAP Message Example
SOAP Receiver now
<?xml version='1.0' ?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Body> <flightresponse xmlns:env=”urns”> <type>Singapore Airlines</type>
<type>United Airlines</type> </flightresponse> </env:Body></env:Envelope>
SOAP Sender now
![Page 8: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/8.jpg)
What about RPC?
Messaging model is extensible SOAP defines additional elements that
facilitates RPC SOAP is very flexible and lets you define any
method signature. A unique URI needs to be passed which
identifies the SOAP Node that contains or supports the RPC.
![Page 9: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/9.jpg)
SOAP RPC Example Request
<?xml version="1.0"?><env:Envelopexmlns:env="http://www.w3.org/2003/05/soap-
envelope"><env:Body> <m:GetPrice
xmlns:m="http://urwebsite/prices"> <m:Item>Apples</m:Item> </m:GetPrice></env:Body></env:Envelope>
![Page 10: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/10.jpg)
SOAP RPC Example Reply
<?xml version="1.0"?><env:Envelopexmlns:env="http://www.w3.org/2003/05/soap-
envelope"><env:Body> <m:GetPriceResponse
xmlns:m="http://urwebsite/prices"> <m:Price>1.90</m:Price> </m:GetPriceResponse></env:Body></env:Envelope>
![Page 11: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/11.jpg)
SOAP Fault Message
env:Fault – a Subelement of env:Body two mandatory sub-elements - env:Code (which mandates env:Value) - env:Reason – Human Readable Optional env:Detail subelement element Optional env:Node subelement Optional env:Role subelement
![Page 12: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/12.jpg)
SOAP RPC Fault ExampleEnvelope and Body headers.....
<env:Fault> <env:Code>
<env:Value>env:Sender</env:Value> </env:Code><env:Reason> <env:Text xml:lang="en-US">Processing
error</env:Text></env:Reason></env:Fault> End of headers
![Page 13: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/13.jpg)
SOAP HTTP Bindings
Relates the HTTP Response codes with SOAP responses.
Provides a mechanism to specify the URI which identifies the SOAP node which “contains” or “supports” RPC.
![Page 14: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/14.jpg)
HTTP Request Example
GET/travelcompany.example.org/reservations?code=FT35ZBQ HTTP/1.1
Host: travelcompany.example.orgAccept: text/html;q=0.5, application/soap+xml
![Page 15: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/15.jpg)
HTTP Response
HTTP/1.1 200 OKContent-Type: application/soap+xml; charset="utf-8"Content-Length: nnnn
<?xml version='1.0' ?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-
envelope"> <env:Body> <flightresponse xmlns:env=”urns”> <type>Singapore Airlines</type> <type>United Airlines</type> </flightresponse> </env:Body></env:Envelope>
![Page 16: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/16.jpg)
HTTP SOAP Fault Example Associated with a HTTP Post
HTTP/1.1 500 Internal Server ErrorContent-Type: application/soap+xml;
charset="utf-8"Content-Length: nnnn<?xml version='1.0' ?><env:Envelope.........<env:Body> <env:Fault>............
![Page 17: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/17.jpg)
Where is it used?
Key component of .Net Architecture Google services through SOAP Amazon store SOAP API Flickr Services SOAP with AJAX (Eg: W3C validator through Soap)
![Page 18: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/18.jpg)
Alternatives
REST – Representative State Transfer JSON RPC XML RPC WDDX – Web Distributed Data eXchange LDO – Lightweight Distributed Objects HTTP EXT (RFC 2744)
![Page 19: SOAP](https://reader035.fdocuments.in/reader035/viewer/2022072016/5681314d550346895d97c752/html5/thumbnails/19.jpg)
Links
SOAP Links: http://www.w3.org/TR/soap/ http://searchwebservices.techtarget.com/searchWebServices/dow
nloads/what_is_soap.swf http://www.soaprpc.com/faq.html http://www.w3schools.com/soap/Soap Implementations: Apache SOAP - http://ws.apache.org/soap/ SOAP:Lite