The Java 2 Micro Edition (J2ME) Web Service specification is an attempt at standardizing programmatic access to Web services from J2ME client applications. Currently, this specification exists as Java Specification Request (JSR) 172 as part the Java Community Process (JCP). More information about JSR-172 can be found at http://www.jcp.org.
Web services can be accessed by J2ME clients today, but involve low-level network APIs that result in non-standard and proprietary implementations. Other specifications and initiatives, such as Java API for XML Processing (JAXP) and Java API for XML-based RPC (JAX-RPC), have addressed high-level and standardized means of accessing XML-based Web services from Java platforms. However, these initiatives do not sufficiently address the unique requirements and limitations of mobile environments, including footprint, computational resources, and wireless networks.
The goal of JSR-172 is to augment the J2ME platform to support two additional capabilities:
Since the JSR-172 separates its support of Web services from its support of XML parsing, the remainder of this chapter discusses only the Web services support.
The JSR-172 specification includes APIs that programmers can use to access remote Web services. The specification does not include any special server-side APIs, but instead specifies only client-side APIs.
The client-side APIs specified by the JSR-172 specification are the following APIs of the JAX-RPC specification:
All J2ME Web service runtime system implementations must implement the above APIs.
The current version of the JSR-172 specification requires that developers building mobile applications that directly invoke remote Web services follow these steps:
These steps are inline with standard Web service invocations using stubs. By following these steps and using an implementation of the JSR-172 specification, J2ME developers can easily build and deploy Web services-based mobile applications.