What is the difference between the SOAP and HTTP protocol. When we say "SOAP over HTTP", what does that mean.?
-
1http://stackoverflow.com/questions/792524/soap-versus-http – Gopi Mar 06 '14 at 06:37
3 Answers
You can serve any content over HTTP such as HTML, images, sound, video, etc. SOAP is an XML-based encoding of messages that are typically sent over HTTP, but could be sent over SMTP or even FTP, although I've never seen such a system used in a production environment.
Just like HTTP sits on top of TCP/IP, SOAP sits on top of HTTP. Layers on top of layers...
If you look at a SOAP request, you can see both layers, with the HTTP headers at the top, followed by the SOAP message. From the w3schools SOAP tutorial:
--------- HTTP portion of the message ------
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
--------- SOAP portion of the message ------
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
More reading for you:

- 12,047
- 2
- 56
- 65
-
HTTP is over TCP, not over TCP/IP, TCP/IP is the whole stack which includes the application layer(SOAP in the the application layer). You can't say the SOAP sits over something that includes SOAP. – Gab是好人 Sep 13 '15 at 21:31
-
3HTTP is over TCP *and* IP. In the OSI model, TCP is in the transport layer and HTTP (and SOAP) is in application layer. See https://en.wikipedia.org/wiki/OSI_model. But that doesn't change the answer. Just a like a roof sits on top of a house, SOAP is layered on HTTP. You can argue a roof and a house are in the same layer, but the roof is still on top of the house. – lreeder Sep 14 '15 at 03:11
-
@Ireeder When we say TCP/IP, it is no longer the OSI model of 7 layers but the TCP/IP Protocol Stack of 4 layers. Here "On top of" should mean that one is immediately included in the other. – Gab是好人 Sep 14 '15 at 11:47
To interact with server, request should be in XML encoded format using SOAP. But in case of HTTP, request can be sent in HTML, Image, video format etc. SOAP request are sent using HTTP protocol.

- 59
- 2
SOAP stands for Simple Object Access protocol. It is XML based used for sending and receiving messages. It is defined with in XML.
Example.
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.example/2003/05/soap-envelope/"
soap:encodingStyle="http://www.example.com/2003/05/soap-encoding">
<soap:Body>
<m:GetPriceResponse xmlns:m="http://www.example.com/prices">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>
smtp stands for Simple Mail Transfer Protocol. Simple Mail Transfer Protocol is a way to transfer email reliably and efficiently. smtp is used to send mail to the recipient's mailbox,thus using various methods to access the emails in his mailbox. smtp by default uses tcp port 25. The protocol for mail submission is the same, but uses port 587. smtp connections secured by [SSL], known as smtps, default to port 465 (nonstandard, but sometimes used for legacy reasons). We can send messages synchronously or asynchronously. Sessions can be automatically managed.
SOAP is language dependent, But SMTP is Language independent. SOAP is mainly used for XML webservices. SMTP is also using http protocol to get or post information.

- 5,607
- 3
- 39
- 65

- 59
- 2