Choosing between SOAP and REST
The choice of adopting SOAP rather than REST depends on your application's require-
ments. SOAP web services are exposed using their own well-defined protocol and focus on
exposing pieces of application logic as services. So if your requirement is to consume busi-
ness services that are exposed using a well-defined and negotiated contract (between the
service consumer and service provider), SOAP web services are a perfect match.
On the other hand, if you need to access some server resources using stateless HTTP invoc-
ations and as little as possible of the navigation bar of your browser, you should probably
go with RESTful web services.
That being said, there may still be some scenarios that could fit both the options, and you
are free to choose whichever web service suits your requirements the best. Recently, REST
has gained popularity, thanks to its interoperability. We use only the HTTP protocol and
JSON, which almost every language can handle. Therefore, a REST API developed using
Java EE can be used by a wide variety of clients along with mobile devices. Often, this fea-
ture is a deal breaker when it comes to designing a system.
Search WWH ::