SOAP (Simple Object Access Protocol) is a protocol for exchanging XML-based messages over networks, normally using HTTP/HTTPS. SOAP forms the foundation layer of the web services protocol stack providing a basic messaging framework upon which abstract layers can be built.
There are several different types of messaging patterns in SOAP, but by far the most common is the Remote Procedure Call (RPC) pattern, in which one network node (the client) sends a request message to another node (the server) and the server immediately sends a response message to the client.
SOAP is the successor of XML-RPC. SOAP makes use of Internet application layer protocol as a transport protocol. Both SMTP and HTTP are valid application layer protocols used as Transport for SOAP, but HTTP has gained wider acceptance. Specifically, HTTP/S works well with network firewalls. This is a major advantage over other distributed protocols like GIOP/IIOP or DCOM which are normally filtered by firewalls.
XML was chosen as the standard message format because of its widespread use by major corporations and open source development efforts.
The somewhat lengthy syntax of XML is both a benefit and a drawback. While it promotes readability for humans, facilitates error detection, and avoid interoperability problems such as byte-order, it can retard processing speed and cumbersome.
In an environment where JavaScript is available, JSON is much better than SOAP, because JSON is more compact. It is better to use JSON for AJAX requests. In other environment, SOAP is much more applicable.





