210
Developing Client Applications to Use a Web Service
Applications for J2ME devices have a standard, uniform set of GUI widgets
available for manipulating data, such as the liquid crystal display UI that is part of
MIDP 1.0 and MIDP 2.0. Plus, each device type may have its own set of widgets.
Such widgets have different abilities for validating data prior to accessing a
service.
J2ME devices, while capable of small computations and data validation, have
limited processing capabilities and memory constraints. Client applications need
to consider the types of data exchanged and any pre and post processing
required. For example, J2ME devices have limited support for XML document
processing and are not required to perform XML document validation.
In summary, keep the following considerations in mind when designing J2ME
clients.
E
Connectivity and bandwidth limitations
J2ME clients may have limited
bandwidth, intermittent disconnects, and fees for connection usage.
E
Processing power
The processing capabilities of a Web service client
should be considered in its design.
E
State maintenance
J2ME clients may operate in a connected or disconnect
ed mode, requiring the maintenance of state and synchronization between cli
ent and service.
5.3
Developing Client Applications to Use a Web Service
All client applications follow certain steps to use a Web service. In brief, they must
first look up or locate the service, make a call to the service, and process any
returned data. The choice of communication mode determines much of the details
for performing these steps.
An application can communicate with a service using stubs, dynamic proxies,
or the dynamic invocation interface (DII)
Call
interface. (The next section
explains these modes.) With these modes, a developer relies on some form of
client side proxy class (stub, dynamic proxy, or a DII interface) representing a
Web service to access the service's functionality. The client developer decides
which representation to use based on the WSDL availability, the service's end
point address, and the use cases for the service.
After deciding on a communication mode, developers need to do the follow
ing when designing and developing client applications:
New Page 1