(The Bell rings) Hojun: Who is it? A: Pizza Delivery~ Hojun: Okay. (Opens the door.)
S O A P ‘the protocol formerly known as Simple Object Access Protocol’ Team Pluto Bonnie,...
-
Upload
silvester-horn -
Category
Documents
-
view
217 -
download
0
Transcript of S O A P ‘the protocol formerly known as Simple Object Access Protocol’ Team Pluto Bonnie,...
S O A PS O A P‘the protocol formerly known as‘the protocol formerly known asSSimple imple OObject bject AAccess ccess PProtocol’rotocol’
Team PlutoTeam Pluto
Bonnie, Brandon, George, Hojun
OverviewOverview
What is SOAP?What is SOAP? SOAP HistorySOAP History Message Exchange PatternMessage Exchange Pattern SOAP Structure SOAP Structure DemoDemo AlternativesAlternatives Q&AQ&A
What is SOAP?What is SOAP? Original Acronym: Original Acronym:
SSimple imple OObject bject AAccess ccess PProtocolrotocol(no longer used as it was misleading; dropped in (no longer used as it was misleading; dropped in
1.2)1.2)
It is a lightweight communication protocol for It is a lightweight communication protocol for exchanging information in a distributed environmentexchanging information in a distributed environment
SOAP uses SOAP uses XMLXML and and HTTPHTTP
It can invoke methods, servers, It can invoke methods, servers, services and objects via the Internetservices and objects via the Internet
AdvantagesAdvantages Platform and language independent Platform and language independent
Allow programs written in different languages running on Allow programs written in different languages running on different platforms to communicate with each otherdifferent platforms to communicate with each other
Simple and extensibleSimple and extensible Minimum functionality Minimum functionality Format is simple and human-readableFormat is simple and human-readable
Standard HTTP protocol is ‘firewall friendly’Standard HTTP protocol is ‘firewall friendly’
HistoryHistory
SOAP follows the principle:SOAP follows the principle:
Invent no new technology!Invent no new technology!
Using two commonly deployed technologiesUsing two commonly deployed technologies(XML and HTTP), SOAP facilitates (XML and HTTP), SOAP facilitates interoperability between interoperability between programs and platformsprograms and platforms
Message Exchange Pattern Message Exchange Pattern Remote Procedure CallRemote Procedure Call
RPC has two RPC has two types of messagestypes of messages
Request Request - - Client sends a request to the server to invoke a serviceClient sends a request to the server to invoke a service
Response Response - Server sends back the result- Server sends back the result
3-Part Structure of a SOAP 3-Part Structure of a SOAP MessageMessage
EnvelopeEnvelope Defines the XML document as a SOAP messageDefines the XML document as a SOAP message Must have the namespace Must have the namespace
http://www.w3.org/2001/12/soap-envelopehttp://www.w3.org/2001/12/soap-envelope Header (optional)Header (optional)
Holds control informationHolds control information BodyBody
Contains the data you are trying to sendContains the data you are trying to send Can have a Can have a <fault><fault> element to element to
handle and carry error messageshandle and carry error messages
Request MessageRequest Message<?xml version="1.0" encoding="UTF-8"?><?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:testns“xmlns:ns1="urn:testns“xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">">
<SOAP-ENV:Body><SOAP-ENV:Body><ns1:<ns1:getProfgetProf>>
<course><course>470470</course></course></ns1:getProf></ns1:getProf>
</SOAP-ENV:Body></SOAP-ENV:Body>
</SOAP-ENV:Envelope> </SOAP-ENV:Envelope>
Response MessageResponse Message<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:testns" xmlns:ns1="urn:testns" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodSOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">ing/">
<SOAP-ENV:Body><SOAP-ENV:Body><ns1:<ns1:getProfResponsegetProfResponse>>
<Result><Result>AnthonyAnthony</Result></Result></ns1:getProfResponse></ns1:getProfResponse>
</SOAP-ENV:Body></SOAP-ENV:Body>
</SOAP-ENV:Envelope> </SOAP-ENV:Envelope>
DemoDemo
SOAP Client written in PHPSOAP Client written in PHP Profname.wsdlProfname.wsdl Client SourceClient Source Server Response Result ShownServer Response Result Shown
DemoDemo
SOAP Client written in PHPSOAP Client written in PHP Source Code for Server SideSource Code for Server Side Source Code for Client SideSource Code for Client Side Request and response messages capturRequest and response messages captur
ed and displayeded and displayed
Client connect to unknown serverClient connect to unknown server
Problems with SOAPProblems with SOAP Data needs to be converted to strings Data needs to be converted to strings
(instead of being transmitted in binary form)(instead of being transmitted in binary form) Lengthy XML messages are slower to Lengthy XML messages are slower to
transmit transmit (less of an issue with short messages)(less of an issue with short messages) You have to do more work You have to do more work
(SOAP does not define how receiving a (SOAP does not define how receiving a messagemessage
will create an instance of the object will create an instance of the object
and execute the method)and execute the method)
AlternativesAlternatives
XML-RPCXML-RPC Designed by Dave Winer of UserLand Software Designed by Dave Winer of UserLand Software
with Microsoft, 1998with Microsoft, 1998 SOAP's predecessorSOAP's predecessor Advantages:Advantages:
Simple and minimal protocol for remote Simple and minimal protocol for remote execution of java code (entire description execution of java code (entire description can be printed on two pages of paper)can be printed on two pages of paper)
Easy to useEasy to use Disadvantages:Disadvantages:
Too simple; unable to Too simple; unable to handle complex interactionshandle complex interactions
Mostly replaced by SOAPMostly replaced by SOAP
AlternativesAlternatives CORBA CORBA
((CCommon ommon OObject bject RRequest equest BBroker roker AArchitecture)rchitecture) Advantage:Advantage:
Most complete RPC protocol Most complete RPC protocol Good for implementation in server farms or large Good for implementation in server farms or large
groups of homogenous systems on a dedicated groups of homogenous systems on a dedicated networknetwork
Disadvantage:Disadvantage: Too complex for most applications Too complex for most applications Difficult to implement with a high Difficult to implement with a high
number of clients number of clients Though implemented on a variety Though implemented on a variety
of platforms, in practice any of platforms, in practice any given deployment needs to be ongiven deployment needs to be ona single consistent implementationa single consistent implementation
AlternativesAlternatives
DCOM DCOM ((DDistributed istributed CComponent omponent OObject bject MModel)odel)
Only for WindowsOnly for Windows Advantage:Advantage:
Highly efficient and flexibleHighly efficient and flexible Disadvantage:Disadvantage:
Very complicated to configureVery complicated to configure Hard to work in modern web environmentHard to work in modern web environment Deprecated by .NETDeprecated by .NET
Thank you!Thank you!
Are there any points we can Are there any points we can clarify for you?clarify for you?