Chapter 7: Enabling Mobile Web Services
7.1 Mobile Web Services Software Development
The mobile domain is becoming open to the increasing availability of information and services on the Web. Mobile devices can browse the Web and are often connected to Personal Information Management (PIM) services (such as e-mail, scheduling, and contacts) along with other enterprise systems. There is demand to incorporate new applications and functions that make particular sense to mobile users, such as providing traffic and airport data, or other localized information.
Given the staggering number of mobile devices in use, and their upgrade rate, the opportunities are great for all parties involved (service consumers, enterprises, network operators, and service providers). Given also the dynamic nature of the mobile industry, the modular, loosely coupled nature of Web services technology promotes new business partnerships and collaboration opportunities for those managing mobile user accounts (such as mobile network operators) and different service providers.
As Web services are built on the foundation of the Web, offering mobile Web services is dependent on the physical capabilities of the mobile Web. The mobile Web differs from the fixed Web in significant ways. Mobile devices are subject to well-documented limitations.
The processing power of mobile handsets may be restricted in terms of CPU capabilities, addressable memory, and persistent memory.
The user interface is limited in terms of both screen size and input facilities. The data network is constrained in both data throughput and latency. However, in all of these areas, mobile devices are improving dramatically.
Mobile operating systems and user interfaces are becoming increasingly powerful and sophisticated, as proven by the Symbian operating system and the Nokia S60 platform. These advanced platforms have opened up their local resources to host third-party applications.
Current wireless packet switching protocols (such as GPRS) offer greater capacity, bit rates, and always connected functionality. These emerging mobile enhancements are creating positive conditions for mobile device–hosted Web service applications.
The constraints described above could limit the performance of Web services on the mobile device. Web service messages are sent as XML documents, so bandwidth, processing, and memory limitations may affect perceived application performance.
There are differences between developing software for a mobile device and developing software for a personal computer or a server.
Because of the hardware and network limitations described above, it must be ensured that users are affected as little as possible by these limitations. This often means a great deal of work for the application developer.
The SOA for S60 platform has been designed to consider these differences and to ease the life of a Web services software developer in a number of ways. It does this by taking advantage of a number of features present in the Symbian operating system that are custom-built for developing software for the mobile device. These features are presented in the following sections.
7.1.1 Client-Server Architecture
The S60 and Series 80 platforms, which are both based on Symbian, provide a client-server architecture, which is used extensively in the SOA for S60 platform. A client process (the application) exchanges messages with Symbian server processes, managed by the Symbian kernel process. The benefit of this architecture is that if a server process crashes, Symbian takes care of the cleanup to prevent the whole platform from crashing.
In an environment where an application depends heavily on external network connections, separating the client application from the application server making the network connection allows the client to be somewhat insulated from network errors and latency. In the SOA for S60 platform, Web service consumer applications are also Symbian client applications. The SOA for S60 platform Service Manager is both a
Symbian server process and a Symbian client process of other Symbian server processes. This architecture ensures a level of robustness in the unstable networking and battery-powered environment of a mobile device.
7.1.2 Active Objects
The Symbian environment uses a feature called Active Objects to allow a software application to register a callback method. This means that the application can send a message to another process asynchronously, without having to wait for a response. This enables the client application to send a message and then perform other functions (such as updating a screen) rather than being forced to wait for a response.
The SOA for S60 platform makes use of active objects in many places, the most notable being the basic interface (CSenServiceConsumer) implemented as service consuming software applications. Active objects allow the application developer to write applications that can send Web service messages asynchronously. The SOA for S60 platform ensures that the consuming application is notified when a response message arrives, rather than having the application wait for a response from the Web service.
7.1.3 Symbian HTTP Stack
The Symbian platform offers access to network transport via an HTTP client stack. This feature allows, for example, HTTP Basic Authentication, and is the basis for the network connections established by the SOA for S60 platform.
7.1.4 XML Processing
The Symbian Series 80 and S60 platforms provide basic XML processing capabilities. The SOA for S60 platform supplements these by offering a simplified method of XML parsing to be used in Web services. These features enable efficient implementation of XML parsing on a mobile device, specifically for the purpose of parsing (typically) small XML messages (see section 7.7 below).
As noted earlier, the SOA for S60 platform APIs will be available in both Symbian C++ and Java. The Java environment for mobile devices also has to account for the differences inherent in mobile software development. This leads to the Java SOA for S60 platform architecture being based on a Java Native Interface (JNI) wrapper for Symbian SOA for S60 platform libraries. This allows the implementation of a suitable Java
interface, while enjoying the excellent architecture for mobile software development provided by the Symbian environment.
The appropriate wrapper for the set of platform libraries allows a similar programming model to be provided across all languages that Nokia supports on its mobile devices.
As noted earlier in the book, Web service transactions involve a software application taking the role of either a service consumer or a service provider. Applications using SOA for S60 platform APIs may (in the future) assume either role, exposing mobile device-based functionality (such as your personal calendar or contacts) via a Web service interface.
By using Web services, rather than Web pages (via a Web browser), software developers can create a better mobile-specific user interface because they are not tied to HTML. Web service messages tend to be small compared to HTML pages, as they do not contain presentation layer information.