SOAP - Simple Object Access Protocol

AnushkaPatil2 3,240 views 14 slides Oct 03, 2018
Slide 1
Slide 1 of 14
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14

About This Presentation

A detailed description of Simple Object Access Protocol (SOAP)
Content:
What is SOAP?
Why SOAP?
SOAP Transport Methods
SOAP Messaging Framework
SOAP Message
SOAP Request Message
SOAP Response Message
Pros & Cons of SOAP

References provided


Slide Content

SOAP Simple Object Access Protocol - Anushka Harshad Patil

Content What is SOAP? Why SOAP? SOAP Transport Methods SOAP Messaging Framework SOAP Message SOAP Request Message SOAP Response Message Pros and Cons of SOAP

What is SOAP? SOAP stands for Simple Object Access Protocol A lightweight XML-based communication protocol Designed to communicate via Internet Simple and Extensible Platform and Language Independent It is a W3C standard

Why SOAP? It is important for application development to allow Internet communication between programs. Today's applications communicate using Remote Procedure Calls (RPC) between objects like DCOM and CORBA, but HTTP was not designed for this. RPC represents a compatibility and security problem; firewalls and proxy servers will normally block this kind of traffic. Since Web protocols are installed and available for use by all major operating system platforms, HTTP and XML provide an at-hand solution as it is supported by all Internet browsers and servers. SOAP provides a way to communicate between programs running on disparate operating systems, with different technologies and programming languages.

SOAP Transport Methods Both SMTP and HTTP are valid application layer protocols for SOAP but HTTP has gained wider acceptance as it works well with today's Internet infrastructure. SOAP works well with network firewalls, since HTTP is typically Port 80 compliant, where other calls may be blocked for security reasons XML was chosen as the standard message format. The somewhat lengthy syntax of XML can be both a benefit and a drawback. Its format is possible for humans to read, but can be complex and can have slow processing times. For example, CORBA, GIOP, ICE, and DCOM use much shorter, binary message formats. Binary XML is also being explored as a means for streamlining the throughput requirements of XML.

SOAP Messaging Framework XML-based messaging framework that is Extensible Interoperable Independent Extensible: Simplicity Defines a communication framework that allows for features such as security, routing, and reliability to be added later as layered extensions Interoperable: Used over any transport protocol such as TCP, HTTP, SMTP Provides an explicit binding today for HTTP Independent: Allows for any programming model and is not tied to RPC Defines a model for processing individual, one-way messages Allows for any number of message exchange patterns (MEPs)

One-Way Message Request/ Response

SOAP Message Format SOAP message consists of three parts: SOAP Envelope SOAP Header (optional) SOAP Body Envelope element is always the root element of a SOAP message. It contains the header and body element. Body represents the message (XML) payload Headers are structured the same way. Can contain additional payloads of “metadata” Security information, quality of service, etc.

SOAP Message A SOAP message may be used to convey a document or to support client-server communication. The document to be communicated is placed directly inside the body element, together with a reference to an XML schema containing the service description. This sort of SOAP message may be sent either synchronously or asynchronously. For client-server communication, the body element contains either a Request or a Reply.

SOAP Request Message The SOAP message represents a request to transfer funds between bank accounts: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <x:TransferFunds xmlns:x="urn:examples-org:banking"> <from>22-342439</from> <to>98-283843</to> <amount>100.00</amount> </x:TransferFunds> </soap:Body> </soap:Envelope>

SOAP Re sponse Message If the receiver supports request/response and it is able to process the message successfully, it would send another SOAP message back to the initial sender. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <x:TransferFundsResponse xmlns:x="urn:examples-org:banking"> <balances> <account> <id>22-342439</id> <balance>33.45</balance> </account> <account> <id>98-283843</id> <balance>932.73</balance> </account> </balances> </x:TransferFundsResponse> </soap:Body> </soap:Envelope>

Response Message- Element : Fault It represents errors within the Body element when things go wrong Code snippet represents "Insufficient Funds" error occurred while processing the request: The Fault element must contain a faultcode followed by a faultstring element. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Insufficient funds</faultstring> <detail> <x:TransferError xmlns:x="urn:examples-org:banking"> <sourceAccount>22-342439</sourceAccount> <transferAmount>100.00</transferAmount> <currentBalance>89.23</currentBalance> </x:TransferError> </detail> </x:TransferFunds> </soap:Body> </soap:Envelope>

Pros & Cons of SOAP Pros It is platform and language independent. SOAP provides simplified communications through proxies and firewalls. It has the ability to leverage different transport protocols, including HTTP and SMTP, as well as others. Cons Performance Limitation : typically much slower - uses a verbose XML format Limited to Pooling: only one client can use the services of one server in typical situations Firewall Latency: firewalls do not understand the difference between the use of HTTP within a Web browser, and the use of HTTP within SOAP SOAP has different levels of support, depending upon the programming language supported. SOAP support within Python and PHP is not as strong as it is within Java and .NET.

References https://msdn.microsoft.com/en-us/library/ms995800.aspx “Distributed Systems” Concept and Design by George Coulouris , Jean Dollimore , Tim Kindberg and Gordon Blair. Wikipedia