There are several protocols that exist at different layers of OSI and are used for various functions related to data transfer, communication, encryption and so on. OSI model provides a common reference point and universal set of rules which govern the computing functions. Application layer of the OSI model specifies the shared communication protocols and interface methods used by systems in the communication network. There are several protocols which operate at Application layer such as Telnet, HTTP, SOAP , SMTP, NFS , TFTP etc.
Today we look more in depth about two popular application layer protocols SOAP and HTTP , their functionality, advantages , limitations and use cases.
About SOAP (Simple Object Access Protocol)
SOAP was originally defined as the S-Simple O-Object A-Access protocol. SOAP (Simple Object Access Protocol) is a network protocol to exchange structured data between hosts. XML format is used to transfer messages. It works on top of the application layer for notification and transmission. SOAP allows communication across platforms , languages, and operating systems as it uses HTTP for transport which is already available on all platforms. SOAP is used for Passing documents, Electronic Document Interchange (EDI). and Remote Procedure Calls (RPC).
History of SOAP
SOAP development started in 1998 with no standard scheme for XML and supported limited data types. SOAP was announced in 1999 by Dave Winer and Microsoft. SOAP ver 1.1 was announced in 2000 by MFST & IBM based on XML 1.0. SOAP 1.2 was introduced in 2007 by the XML protocol working group. It has better interoperability, extensibility, and has better support for web standards and internationalization.
The SOAP specification presents the messaging framework and defines rules for processing model defining the rules for processing a SOAP message, rules for defining a binding to an underlying protocol that can be used for exchanging SOAP messages between SOAP hosts.
The SOAP message construct defining the structure of a SOAP message which is an ordinary XML document comprises of :
- Envelop – identified the XML document as SOAP message
- Header – contains header information
- Body – contains call and response information
- Fault – contains errors and fault message
Pros and Cons of ‘SOAP’
- SOAP over HTTP allows easier communication thru proxies and firewalls
- Versatile to allow use of different transport protocols
- SOAP is platform independent
- SOAP is language independent
- SOAP is simple and extensible
- Slower compared to its counterparts
- Only one party can use service of the other
- Not all languages offer appropriate support such as PHP and Python which offer weaker support
HTTP is an application layer protocol majorly used for most data transfer on the web. It is the foundation of data communication using hypertext files on the world wide web. HTTP is responsible for the action the server must take when information is sent on the network. HTTP works on the URL concept and when we type a URL in browser, protocol sends HTTP request to server and then HTTP response is sent back to browser. HTTP is connection oriented – few or no packets exchanged to set up / maintain sessions and it is usable over firewalls.
History of HTTP
HTTP 1.0 was published as RFC 1945 in 1996. HTTP 1.1 standard was defined in RFC 2068 which was officially released in 1997. HTTP 2.0 was released as RFC 7540 in May 2015.
How HTTP works?
HTTP communication involves two important components – Client and Server. Client is the one who makes the HTTP request such that the browser is the client.
Server – Server is the one who receives the request and sends the response. Server is a piece of code which is responsible for accepting the request and sending the response back.
Pros and Cons of ‘HTTP’
- Lower CPU and memory usage due to less simultaneous connections
- Enables HTTP pipelining of requests / responses
- Reduced network congestion due to fewer TCP connections
- Reduced latency in subsequent requests
- Errors can be reported without penalty of closing TCP connections
- If client don’t close connection when all data is received by receiver , server will be unavailable for other clients / requests
- It does not offer reliable exchange
- It does not have push capabilities
- It is not optimized for mobile
Comparison Table: SOAP vs HTTP
Below table summarizes the difference between the two:
|Definition||SOAP (Simple Object Access Protocol) is a network protocol to exchange structured data between hosts||HTTP is an application layer protocol majorly used for most data transfer on the web. It is the foundation of data communication using hypertext files on world wide web|
|Technology||Works over HTTP||Works over TCP and IP|
Download the Comparison Table: SOAP vs HTTP