In a network there is a need for one computer ( server ) to provide some sort of service (similar to a function call ) to another computer on the network ( client ) that can invoke the function call. This was called RPC ( Remote Procedure Call ) . A number of different frameworks supported this style of programming. CORBA (Common Object Request Broker Architecture) and Microsoft’s DCOM (Distributed COM) were 2 of such frameworks. The functional implementation of the service would be written on the server and client side but the actual task of taking that function call and arguments and marshaling ( converting to the format for transport ) and sending the data over the network would be done by the framework libraries. Both of these frameworks were very widely used in networks.
XML-RPC was created in the 1990's that specified a format for sending messages ( function all converted to message ) in the XML format. This eventually formed the basis of what we now know as SOAP. One difference with sending the data in XML format is that the data is textual and not binary. It is easier to see what is being sent. Also the data does not follow a specific protocol in terms of communication.
With Java we have something called Java RMI that can do remote procedure call. However the technology is limited to Java. We cannot use C++ to implement the RMI. The actual data sent or received is binary in nature.
SOAP is not restricted to a specific protocol. The protocol can be "HTTP" or "SMTP" or some other protocol. Since "HTTP" is used for Web communication ; SOAP can work on that protocol . This is a huge advantage over the Corba, Dcom frameworks. Also SOAP is much more open in the sense that the messages are not binary or in a proprietary format. Dcom as an example is limited to Windows systems. SOAP on the other hand is independent of operating systems or languages and there are libraries for implementing SOAP in almost all the languages and different operating systems. Since SOAP relies heavily on XML we will review XML concepts.
XML Review
XML stands for eXentsible Markup Language is a markup language and used to encode text documents. It is easily readable and can be processed by computers. Markup refers to annotating text that defines some metadata associated with the text. XML is used to store data and has become pervasive in storing and exchanging data. Suppose we needed to store some data about a person. We could make our "configuration" file .
"config.txt"
memo_1_to="Ajay"
memo_1_from="Jim"
memo_1_heading="Reminder"
memo_1_body="Remember to teach your class."
memo_2_to="Jim"
memo_2_from="Ajay"
memo_2_heading="Reminder"
memo_2_body="Remember to pay me."
<?xml version="1.0" encoding="UTF-8"?>
<memos>
<memo>
<to>Jim</to>
<from>Ajay</from>
<heading>Reminder</heading>
<body>Remember to teach your class</body>
</memo>
<memo>
<to>Jim</to>
<from>Ajay</from>
<heading>Reminder</heading>
<body>Remember to pay me</body>
</memo>
</memos>
https://www.w3schools.com/xml/default.asp
Soap Example
http://www.thejavageek.com/2015/01/23/hello-world-web-service-example/