130 likes | 144 Views
SOAP is a protocol for information exchange between applications via the Internet, defining a way of passing XML data and performing remote procedure calls. Learn about SOAP origins, structure, functionality, and benefits.
E N D
What is SOAP? • Protocol for information exchange between applications via Internet. • W3C web services standard. • Defines a way of passing XML-encoded data, including binary content. • Defines a way of performing remote procedure calls (RPCs).
Where did SOAP come from? • Coauthored by representatives of IBM, Lotus, Microsoft, DevelopMentor, and UserLand. • Later submitted to the World Wide Web Consortium (W3C). • Current SOAP development is the domain of the W3C XML Protocol Working Group
How does SOAP work? • Implements the request/response model of HTTP A client sends a SOAP message to a server that processes the request and responds with a SOAP message of its own.
What is a SOAP Message? • Two required components: • Envelope - packages the data • Body - is the data. • A third, optional component: • Header - contains descriptions about the message, data, and/or processing instructions.
Sample SOAP Message <?xml version="1.0"?> <SOAP-ENV:Envelope … > <SOAP-ENV:Body> <camera:getFeed sensor="http://observatory.leo15.edu?sensor=104"> <beginDate>04-28-2005 11:21:00</beginDate> <videoLength>30</videoLength> </ camera:getFeed> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
What does this mean? … <camera:getFeed sensor="http://oservatory.leo15.edu?sensor=1045"> <beginDate>04-28-2005 11:21:00</beginDate> <videoLength>30</videoLength> </ camera:getFeed> … • The observatory may have a sensor defined as ‘camera’. • ‘camera’ has a method called getFeed() • getFeed() has two parameters: • beginDate: the instance in time you want the returning video file to begin • videoLength: how much video do you want to see
What could the response be? <?xml version='1.0' ?> <SOAP-ENV:Envelope …> <SOAP-ENV:Body> <camera:getFeed id=“104"> <position>30 degrees</position> <direction>NNE</direction> <timestamp>04/29/2005 12:34:05</timestamp> <temperature>36 degrees</temperature> <!-- ... More metadata might go here... --> <videoFeed href="cid:04282005113000.mov@leo15.edu"/> </camera:getFeed> </SOAP-ENV:Body> </SOAP-ENV:Envelope> --<MIME Attachment> Content-Type: video/quicktime Content-Transfer-Encoding: binary Content-ID: <cid:04282005113000.mov@leo15.edu> ...Raw MOV image…
Why use SOAP? • Platform & Language independent. • It is a W3C standard, a standard amongst the web services community, and it’s “eXstensible” • Allows for binary data attachments. • Enforce processing requirements with xml schemas written for MathML, and other data definitions.
Resources Gentle Introduction to SOAP A Busy Developer's Guide to SOAP 1.1 W3C Links: SOAP Specification(W3C) SOAP 1.2 Attachment(W3C)