Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between SOAP and HTTP protocol?

What is the difference between the SOAP and HTTP protocol. When we say "SOAP over HTTP", what does that mean.?

like image 728
user0 Avatar asked Oct 08 '13 15:10

user0


People also ask

Does SOAP use HTTP protocol?

SOAP is a method of transferring messages, or small amounts of information, over the Internet. SOAP messages are formatted in XML and are typically sent using HTTP (hypertext transfer protocol). SOAP uses WSDL for communication between consumer and provider, whereas REST just uses XML or JSON to send and receive data.

Does SOAP use HTTP or HTTPS?

SOAP describes the structure and data types of message payloads by using the emerging W3C XML Schema standard issued by the World Wide Web Consortium (W3C). SOAP is a transport-agnostic messaging system; SOAP requests and responses travel using HTTP, HTTPS, or some other transport mechanism.

Why would you use SOAP instead of HTTP?

It is important to note that one of the advantages of SOAP is the use of the “generic” transport. While REST today uses HTTP/HTTPS, SOAP can use almost any transport to send the request, using everything from the afore mentioned to SMTP (Simple Mail Transfer Protocol) and even JMS (Java Messaging Service).

What is SOAP over HTTP means?

SOAP (Simple Object Access Protocol) is a message protocol that enables the distributed elements of an application to communicate. SOAP can be carried over a variety of standard protocols, including the web-related Hypertext Transfer Protocol (HTTP).


1 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:

  • http://en.wikipedia.org/wiki/HTTP
  • http://en.wikipedia.org/wiki/SOAP
like image 135
lreeder Avatar answered Sep 20 '22 14:09

lreeder