Building iPhone Business Applications using Web Services
S OLU T I ON PAP ER
Š 2010 Ivesia All rights reserved
S OLU T I ON PAP ER
INTRODUCTION
iPhone application development trends are slowly moving towards business use cases, according to a study by iPhoneAppQuotes.com. What once was a 50/50 split between business applications and consumer applications is now a 70/30 split in favor of business applications. Medical, education, business and book applications are the most requested categories of applications in the Apple App Store. iPhone apps are just another extension of a business's reach, from the branding, sales and marketing perspectives, as well as the ability to sell products and services. The iPhone is relentlessly dominating the smartphone market with more than 100,000 applications in its Apple App Store, along with some of the most robust features of any phone to date. It is becoming clearer that individuals and businesses alike want to get in on the mobile applications gravy train, either to promote their business via branding or actually turn a profit. We'll start to see more and more apps with eCommerce, push notifications, social media integration and 3.0 functionality.
2
S OLU T I ON PAP ER
Need for Web Services The moment we speak about business applications, it becomes imperative for us to be communicating with the outside world; especially the iPhone application will have to interact with best-of-breed apps that provide useful functionality. This functionality is made available by so many web services. However, using web services in iPhone is pretty tricky for Xcode does not have inbuilt tools that can use web services easily. Everything needs to be done manually where one has to send the XML messages to the web services and then parse the retuning XML result. Many web services and APIs were originally developed with server to server or server to browser in mind, and not mobile applications. Mobile platforms have their own set of problems like bandwidth, memory & CPU availability, storage capacity, connectivity options & issues, security, and user interaction & display. There is no native framework stack for SOAP web services. However, interacting with SOAP without a framework is not that difficult, and it is similar to implementing a REST-ful web service and is a manipulation of XML messages.
Is SOAP the right choice? SOAP is considered too heavy for mobile applications. The key question is, why do all the work to wrap requests in an additional XML layer you'll have to parse? You send more data than you need to, and impose greater CPU burden on client and server. Fundamentally, SOAP is a HTTP based protocol and you have all the libraries needed to do HTTP on the iPhone. Hence, lot of applications started using SOAP for web services. However, REST-ful APIs are simpler than SOAP and they are also based on HTTP and there shouldn't be any problems in using that on iPhone. The reason that SOAP is complicated is because of its inherent wrapping nature. SOAP gets used on top of HTTP protocol that already has features to do anything you can with SOAP, especially so with the subset of SOAP supported by most libraries. The needs of an iPhone application greatly varies like Blending results from multiple calls in the same API Blending results from multiple API sources This puts additional burden on the mobile application to process and present it to the mobile view. This can be easily handled by brining in a proxy server between the iPhone and the Web Service, which handles the service calls and not the mobile applications. Proxy allows for caching of processed results to serve same client or other clients - in memory or database, which helps in reducing call volumes to web services.
3
S OLU T I ON PAP ER
Proxy Server Landscape
Solution components Database
Web Service
Provides layers of abstraction to consolidate or manage web services Proxy server retrieves data on demand or on scheduled basis
Database
Allows for single consolidated call from the mobile device
Internet
Proxy Server
Processes data and returns subset or stores data for retrieval later Reduce API calls by caching similar results across users Allows for extending business logic layer
Database
Provides easy maintenance of web services business logic layer Web Service
Easy to modify business logic and API credentials
About Ivesia Ivesia is a leading provider of Information Technology and enterprise wide software solutions with a talented project management team. Ivesia offers software development services and IT consulting services through a global yet local approach with its customers in different countries. Ivesia accomplishes this through a proven development methodology that continues to be refined with every engagement. State-of-the-art technology centres in the U.S. and India provides 24x7 support and services and the cost advantages of offshore development, as well as the quality and security of domestic project management in the United States.
Ivesia's portfolio of services includes: Product Engineering Software Development Software Testing SharePoint Development Smartphone Application Resource Consulting
New Hampshire Office Corporate Headquarters 2 Keewaydin Drive, Salem, NH 03079, USA Phone: (603) 890-1010, (603) 685-2400 Fax: (603) 890-1276 Email: info@ivesia.com
4
Offshore Development Center 36 Vijaya Raghava Road, T. Nagar, Chennai - 600 017, Tamil Nadu, India Phone: 91 44 28155583 - 84 Email: offshore@ivesia.com