Many enterprises are creating mobile applications for their internal staff, for their customers, or both. These applications need access to data, business rules, and business processes. For architectural and security reasons these applications are typically built to access remotes services that provide the data and functionality that are required by the users.
Because many web applications have been built over the last decade using SOAP-based web services, many architects have made the assumption that these same SOAP-based services are the best choice for mobile applications. We believe that the use of RESTful services, with data in JSON format is a better choice for mobile applications whether the client device technology is iOS, Android, Blackberry, or even Mobile Web.
In this article, we look at the differences between SOAP and REST for use by mobile applications, analyze typical assumptions about them, and offer an approach that is geared specifically for the unique challenges involved in building mobile applications, especially for multiple platforms.
Before diving into an analysis of SOAP vs. REST, it will be useful to define the terms used in the analysis.
SOAP is a well-known technology that has been used effectively within a SOA framework for some time. Many enterprises have established service tiers within their IT infrastructure to offer services to diverse applications, both inside and outside the firewall. SOAP was designed to take advantage of many different types of data transport layers including synchronous HTTP/HTTPS, asynchronous queues like MQSeries™, and even over email. This capability helps SOAP be a single solution for many heterogeneous interconnectivity problems. However, SOAP was designed before the explosion of mobile technology and mobile applications.
Pssst… REST does more things well, isn’t it true ? 😉
Which web services approach to use is a fundamental decision that can affect the success of a mobile application. For the reasons mention in this document, we believe that RESTful services, when implemented properly offer the best combination of:
… to contribute to the success and timeliness of delivery of a mobile application. I also believe that it often makes sense to organize those services into a “Mobile Facade” built using REST, and delivering data in JSON format. The “Mobile Facade” aggregates internal service endpoints into a single contact point for the mobile application. This facade will isolate the mobile devices from changes within the enterprise, thereby reducing the number of required mobile application updates. The facade can also implement some business logic to aggregate multiple internal service calls into a single mobile call for the purpose of simplifying the mobile application and improving the customer experience.