-: Let's begin with SOAP.
So, SOAP is an acronym stands
for Simple Object Access Protocol.
It was designed in 1998 for Microsoft.
Notice this is not by Microsoft but for Microsoft.
It's an XML based protocol.
Now, if you think that XML is quite outdated
then you are probably right.
But again, remember this protocol is more
than 20 years old by now, and in the previous century
actually in the previous millennium,
XML was a King.
SOAP uses an RPC style request response meaning,
when a client calls a server
it calls a specific method or a specific procedure.
RPC stands for Remote Procedure Call.
Which means that the client calls a very specific method.
Also, one of the important attributes of SOAP is
that it extensible.
Meaning there is a base protocol
which is used to call a method and get a response
and it could be extended also for various attributes
such as authentication, routing,
transaction, federation, and so on.
Here is a small example of a SOAP request.
Notice the XML and the quite strict format of it.
So here we have the envelope,
which contains some metadata about the request,
and then we have the body of the request.
And in this case, the body tells us
that we are calling a method called Get Stock Price
and pass a parameter named stock name with the value of IBM.
In other words, we ask the server to give us
the current value of the IBM stock.
Now what you need to know about SOAP is
that it is quite outdated and generally you shouldn't use it
unless you really, really have to.
If, for example, you are working
with a legacy system that exposes only SOAP endpoints.