When you have two servers that you want running 7x24 that need to communicate. We have an environment where we want our servers always available. Through RMI there is a case where one server “A” will cache the connection to another server “B.” When the server “B” goes down, server “A” must flush it’s cache. We have some code that uses an external JNDI service and reloads the RMI connection, but the SOAP code is much simpler.
A second example may be when you want to communicate over HTTP. You may have a thick client that you want deployed on road warriors laptops. Often hotspots restrict other types of traffic.
SOAP has a bit more overhead. We started using it as a means of implementing new code in Java without rewriting all of our C++ and VB code. We have kept it unless we needed optimized communication – sometimes even when both components are now in Java running in the same JVM.