Introduction

  • Initially called as XML-RPC.
  • Stable release version of SOAP is/was v1.2 in April 2007.

Definition

  • SOAP is an XML-based, hence lightweight(i.e. only uses XML format of data/message for request and response), Application layer protocol for accessing/exchanging of information in a decentralized way from several web services distributed over Internet via HTTP protocol mainly. It defines how web services talk/communicate to each other or to client applications that invoke/call them.
  • SOAP is a standards-based web services access protocol that sends messages using other protocols such as HTTP and SMTP.
  • SOAP is the protocol used for data interchange between applications in distributed environment in the form of XML.

Need of SOAP

As we know that in today’s world, there are a large number of web applications which are built in different programming languages and environment per days. For example, there could be a web application designed in Java, another in .Net and another in PHP environment. So, exchanging data between user apps and web applications is crucial in today’s networked world. But data exchange between these heterogeneous applications would be complex and time consuming. So will be the complexity of the code to accomplish this data exchange. Thus, one of the methods used to combat this complexity is appear to use XML (Extensible Markup Language) as the intermediate language for exchanging data between applications.

As it is clear that every programming language can understand the XML markup language. Hence, XML was used as the underlying medium for data exchange. Again, but there are no standard specifications on use of XML across all programming languages for data exchange. That is where SOAP comes into existence.

Thus, SOAP was designed to work with XML over HTTP and have some sort of specification which could be used across all applications.

Features/Characteristics

  • SOAP stands for ‘Simple Object Access Protocol’.
  • All communication by SOAP is done via the HTTP protocol. Prior to SOAP, a lot of web services used the standard RPC (Remote Procedure Call) style for communication. This was the simplest type of communication at that time, but it had a lot of limitations.
  • SOAP is considered as a messaging protocol and is still used in many Web Services or big organizations or institutions of the world. With built-in security and reliability functions, SOAP is a great choice for applications where security is more critical than performance.
  • SOAP is a communication protocol to communicate data/messages between applications.
  • It Uses HTTP (port 80) or SMTP ( port 25 or 2525 ) protocol for message negotiation and transmission.
  • It is independent from any transport protocols i.e. it may work with either any one such as HTTP, FTP, TCP, UDP,SMTP or others).
  • SOAP is a network protocol for exchanging structured data between nodes. It uses XML format to transfer messages.
  • SOAP is more secure than REST protocol as it uses WS-Security(Web Services Security) for transmission along with Secure Socket Layer(SSL) concept.
  • SOAP is state-full process (not stateless) as it takes the entire request as a whole to process it.
  • SOAP allows clients to invoke web services and receive responses which are independent of programming languages and platforms/OS.
  • Working Mechanism : 

When a SOAP client starts a request for a service then it involves creating a conforming XML document, either explicitly or using Oracle SOAP client API. A SOAP client now sends the XML document to a SOAP server. This SOAP request is posted finally using HTTP or HTTPS to a SOAP Request Handler, running as a servlet on a Web server. On getting the request , the web server responds to SOAP client as XML document.

Architecture

  • SOAP Message describes what is sent to the web service and the client application.
  • SOAP messages are normally auto-generated by the web service when it is called i.e. Whenever a client application calls a method in the web service, the web service will automatically generate a SOAP message which will have the necessary details of the data which will be sent from the web service to the client application.
  • The SOAP message tells the client application what is the name of the Web service, and also what parameters it expects and also what is the type of each parameter which is taken by the web service.
  • By default, the SOAP message can contain parameters which could be of simple types such as strings and numbers, but can also be a complex object type.
  • The SOAP message is nothing but a mere XML document which has the following components/elements –
(i) The SOAP Envelope element
(ii) The SOAP Header element (optional)
(iii) The SOAP Body element
(iv) The Fault element (optional)

(i) The SOAP Envelope Element :

      • It defines a framework for describing what is in a message(i.e. message structure) and how to process it.
      • This is the root element of the SOAP message.
      • The SOAP Envelope is used to encapsulate all of the necessary details of the SOAP messages, which are exchanged between the web service and the client application.
      • The SOAP envelope element is used to indicate the beginning and end of a SOAP message.
      • This enables the client application which calls the web service to know when the SOAP message ends.
  • (ii) The SOAP Header Element : 
      • The header element can contain information such as authentication credentials which can be used by the calling application.
      • It can also contain the definition of complex types which could be used in the SOAP message.
  • (iii) The SOAP Body Element : 
      • It contains the details of the actual message.
      • A Body element contains call and response information
      • This element is what contains the actual data which needs to be sent between the web service and the calling application.

(iv) The Fault element (optional) :

      • In fault element, when a request is made to a SOAP web service, the response returned can be of either 2 forms which are a successful response or an error response. When a success is generated, the response from the server will always be a SOAP message. But if SOAP faults are generated, they are returned as “HTTP 500” errors.

Advantage

  • Simplicity – Simple in structure and processing.
  • Portability – Easily operatable in any language or OS/platforms.
  • Firewall friendliness/supportive.
  • Interoperability – Executed in different environment.
  • Universally accepted.
  • When developing Web services, User need to have some of languages which can be used for web services to talk with client applications such as Php, Asp.net, Jsp etc. SOAP is the perfect common medium which was developed in order to achieve this purpose. This protocol is also recommended by the W3C consortium which is the governing body for all web standards.
  • Since, SOAP is a light-weight protocol due to use of XML, hence is used for data interchange between applications quickly.
  • SOAP is designed to be as platform(OS) and language independent hence the SOAP protocol can work in any environment or languages well.
  • SOAP works on the HTTP protocol, which is the default protocol used by all web applications. Hence, there is no sort of customization which is required to run the web services built on the SOAP protocol to work on the World Wide Web.

Disadvantage/Demerits

  • SOAP is too much depend on HTTP protocol to communicate.
  • Serialization process occurs during processing which is by value method not by reference method.

Loading


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.