17.5 Compare with kXML and kSOAP The J2ME Web Services Optional Package does not make kXML and kSOAP obsolete. The kXML and kSOAP libraries work at a lower level and target developers who want more flexibility. In fact, kXML and kSOAP can be used to implement the Optional Package. The major differences between the Optional Package and kXML/kSOAP are as follows:Support for XML processing models: The Optional Package supports only SAX, while kXML supports SAX, XMLPull, and kDOM.Java-centric versus XML-centric: A big feature of the Optional Package is its Java-centric design that treats SOAP RPC calls the same way as Java native RMI RPC calls. However, the trade-off is that we do not have any direct control over the underlying SOAP messages. In contrast, kSOAP allows us to peek into the XML structure, add custom headers/attributes, and manipulate arbitrary nodes. The difference between the Optional Package and kSOAP is analogous to the difference between JAX-RPC and Apache Axis.Custom type mapping: Extensible data marshaling that requires access to the underlying SOAP structure is available only in kSOAP.Support for flexible architecture: The support for Web Services gateways via the SPI is a big plus for the Optional Package.Availability: kXML and kSOAP packages are available in production quality now on almost all MIDP-based and CDC-based devices. Commercial implementation of the Optional Package is still several months away. In fact, the kXML and kSOAP libraries can be used to implement the Optional Package.
|