Letter Analogy
My company has a receiving warehouse. All letters and packages first go there, and from there they are distributed.
A SOAP Server is analogous to the receiving warehouse - the SOAP Server receives all incoming SOAP messages and then distributes each message to the appropriate application for processing.
However, there is one big difference:
- No one in the receiving warehouse is allowed to look inside any letter or package. All decisions about what to do with letters/packages must be made purely by looking at the addressing on the outside. Any attempt to look inside of letters/packages is a violation of Federal Law (U.S.).
- A SOAP Server, on the other hand, is able to "peek inside" the SOAP envelope. In fact, it must do so because the actual target resource is not specified on the outside, but rather, is hidden within the envelope.
With REST all decisions are made based upon the URL and HTTP method.
Thus, REST and SOAP have a fundamental difference in this regard. We will see in the next slides that this causes SOAP to clash with the Web.