Java Reference
In-Depth Information
3. At runtime, invoke methods on the stub corresponding to the service end point's
operational implementation.
4. Package the generated stub with the Java ME client application.
The work here is similar to what you need to do if you want to use the optional sup-
port for Java RMI that I describe in Chapter 11, because the JAX-RPC interface uses the
same overall architecture, relying on a local stub object to provide an interface to the
remote service provider.
While the JAX-RPC interface provides an important option available to you when
interfacing with some existing legacy services, a growing number of web services are
moving toward or fully implement a RESTful approach, in which the relatively heavy
semantics of SOAP is replaced by a more descriptive use of XML. In a way, this is turning
the use of XML back to its origins, in which it's used to provide a human- and machine-
readable description of the contents of a data object. In that regard, it's the second
optional component of JSR 172 that becomes important to you: the XML parser.
The XML parser that JSR 172 defines is a strict subset of the XML parser defined in
JSR 63. It specifies that
• The implementation must not provide any support for the Simple API for XML
(SAX) parsing.
• The implementation must not provide any support for DOM, because DOM is too
heavy in terms of implementation size and runtime memory footprint for use on
Java ME devices.
• The implementation must not support XML Transformations (XSLT).
• The implementation is not required to support XML validation, as validation is
expensive in terms of processing power and memory.
• The implementation must support the predefined XML entities (e.g., & ) but is
not required to support optional XML entities.
• The implementation must support XML namespaces.
• The implementation must support both UTF-8 and UTF-16 character encodings.
The optional parser implementation includes three packages: javax.xml.parsers ,
org.xml.sax , and org.xml.sax.helpers . The first package contains the platform's parser
implementation itself, while the other packages provide utilities for the parser. The
parser implementation must implement the SAX2 parsing interface, as reflected by the
namespace for the packages.
SAX provides a straightforward interface to parsing XML, in which the parser con-
sumes XML from a stream and generates events during parsing that represent specific
 
Search WWH ::




Custom Search