Transcript Slide 1
SOAP ‘the protocol formerly known as Simple Object Access Protocol’ Team Pluto Bonnie, Brandon, George, Hojun Overview What is SOAP? SOAP History Message Exchange Pattern SOAP Structure Demo Alternatives Q&A What is SOAP? Original Acronym: Simple Object Access Protocol (no longer used as it was misleading; dropped in 1.2) It is a lightweight communication protocol for exchanging information in a distributed environment SOAP uses XML and HTTP It can invoke methods, servers, services and objects via the Internet Advantages Platform and language independent Simple and extensible Allow programs written in different languages running on different platforms to communicate with each other Minimum functionality Format is simple and human-readable Standard HTTP protocol is ‘firewall friendly’ History SOAP follows the principle: Invent no new technology! Using two commonly deployed technologies (XML and HTTP), SOAP facilitates interoperability between programs and platforms Message Exchange Pattern Remote Procedure Call RPC has two types of messages Request - Client sends a request to the server to invoke a service Response - Server sends back the result 3-Part Structure of a SOAP Message Envelope Header (optional) Defines the XML document as a SOAP message Must have the namespace http://www.w3.org/2001/12/soap-envelope Holds control information Body Contains the data you are trying to send Can have a <fault> element to handle and carry error messages Request Message <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:testns“ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:getProf> <course>470</course> </ns1:getProf> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Response Message <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:testns" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:getProfResponse> <Result>Anthony</Result> </ns1:getProfResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Demo SOAP Client written in PHP Profname.wsdl Client Source Server Response Result Shown Demo SOAP Client written in PHP Source Code for Server Side Source Code for Client Side Request and response messages captured and displayed Client connect to unknown server Problems with SOAP Data needs to be converted to strings (instead of being transmitted in binary form) Lengthy XML messages are slower to transmit (less of an issue with short messages) You have to do more work (SOAP does not define how receiving a message will create an instance of the object and execute the method) Alternatives XML-RPC Designed by Dave Winer of UserLand Software with Microsoft, 1998 SOAP's predecessor Advantages: Simple and minimal protocol for remote execution of java code (entire description can be printed on two pages of paper) Easy to use Disadvantages: Too simple; unable to handle complex interactions Mostly replaced by SOAP Alternatives CORBA (Common Object Request Broker Architecture) Advantage: Most complete RPC protocol Good for implementation in server farms or large groups of homogenous systems on a dedicated network Disadvantage: Too complex for most applications Difficult to implement with a high number of clients Though implemented on a variety of platforms, in practice any given deployment needs to be on a single consistent implementation Alternatives DCOM (Distributed Component Object Model) Only for Windows Advantage: Highly efficient and flexible Disadvantage: Very complicated to configure Hard to work in modern web environment Deprecated by .NET Thank you! Are there any points we can clarify for you?