380 likes | 797 Views
SOAP. Chandra Dutt Yarlagadda. Introduction. Why ? What ? How ? Security Issues in SOAP Advantages Uses Conclusion. Why Do We Need SOAP. Heterogeneous systems must be able to communicate Need for a protocol that uses that already available resources A firewall-friendly protocol
E N D
SOAP Chandra Dutt Yarlagadda
Introduction • Why ? • What ? • How ? • Security Issues in SOAP • Advantages • Uses • Conclusion
Why Do We Need SOAP • Heterogeneous systems must be able to communicate • Need for a protocol that uses that already available resources • A firewall-friendly protocol • An extensible framework • KISS • Easy to Implement
WHAT IS SOAP • Simple Object Access Protocol • SOAP is a specification for defining... • an encoding style that uses XML to represent information graphs • a standard way to move XML with HTTP • rules for passing messages • error (fault) definition • a medium for performing Remote Procedure Calls (RPC) • one layer in a multi-layer architecture
What do we have to work with? • XML - An extensible framework that is easy-to-use and has a low-cost of entry • HTTP/SMTP - Industry accepted transport protocols that are already supported by Enterprise servers and are friendly with firewalls • In a simple equation SOAP = XML + HTTP
Where are we? Application Web Service Interface Semantics Interface Semantics SOAP Envelope/Header/Body Envelope/Header/Body Message Encoding Message Encoding Transport (e.g. HTTP) Transport (e.g. HTTP) TCP/IP TCP/IP
Header Body How It Works • Envelope package • Header/Body pattern • Similar to how HTTP works
Header • Contains Information such as • Authentication information • Message routes • Logging • Transaction flow
Body • Contains Interface – Specific Information • RPC method name and parameters • Serialized objects (instances of types) • Messages
c = Add(a, b) A Simple Example <Envelope> <Header> <transId>1234</transId> </Header> <Body> <Add> <a>3</a> <b>4</b> </Add> </Body> </Envelope>
System Flow Request <Envelope> <Header> <transId>1234</transId> </Header> <Body> <Add> <a>3</a> <b>4</b> </Add> </Body> </Envelope> Response <Envelope> <Header> <transId>1234</transId> </Header> <Body> <AddResponse> <c>7</c> </AddResponse> </Body> </Envelope>
Client process SOAP Serialization/ De-serialization HTTP Encoding/ Decoding Client code Serialize Method Call Into a SOAP-XML Request Wrap SOAP-XML Request into HTTP Request Make Method Call 1 2 3 HTTP Request sent to SOAP server De-serialize Method Call Into a SOAP-XML Response Extract SOAP-XML Response from HTTP Response Return value HTTP Response received from SOAP server 6 5 4 SOAP Package Process at Client
Actual SOAP Request <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> <SOAP-ENV:Header> <t:transId xmlns:t=“http://a.com/trans”>1234</t:transId> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:Add xmlns:m=“http://a.com/Calculator”> <a xsi:type=“integer”>3</a> <b xsi:type=“integer”>4</b> </m:Add> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Actual SOAP Response <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> <SOAP-ENV:Header> <t:transId xmlns:t=“http://a.com/trans”>1234</t:transId> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:AddResponse xmlns:m=“http://a.com/Calculator”> <c xsi:type=“integer”>7</c> </m:AddResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Binding to HTTP (Request) POST /Calculator.pl HTTP/1.0 Host: www.a.com Accept: text/* Content-type: text/xml Content-length: nnnn SOAPAction: “http://www.a.com/Calculator#Add” <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> <SOAP-ENV:Header> <t:transId xmlns:t=“http://a.com/trans”>1234</t:transId> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:Add xmlns:m=“http://a.com/Calculator”> <a xsi:type=“integer”>3</a> <b xsi:type=“integer”>4</b> </m:Add> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Binding to HTTP (Response) HTTP/1.0 200 OK Content-type: text/xml Content-length: nnnn <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> <SOAP-ENV:Header> <t:transId xmlns:t=“http://a.com/trans”>1234</t:transId> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:AddResponse xmlns:m=“http://a.com/Calculator”> <c xsi:type=“integer”>7</c> </m:AddResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Security • SOAP spec says nothing • Delegated to other levels • Transport (HTTPS/SSL) • Included in interface semantics • Needs standardization • Digital Signature
Uses of SOAP • Databases • Internetworking • E-Commerce Systems • Intelligent Devices
Advantages • Interoperability • Simplicity • Free from Firewalls • Industry Support • Easy to Implement
Conclusion :A Quick Comparison • COM – DCOM • CORBA – IIOP • JAVA - RMI