17.4 The SPI for ImplementersThe SPI specifies the interface to pass data between the generated Stub classes and the underlying implementation. The SPI benefits both application developers and the JSR 172 specification implementers.Application developers can reuse the generated Stub classes when switching implementation providers. This makes the application more portable.Multiple implementation providers can share the same Stub generator and focus on their core businessimplementing the communication and marshaling logic. The SPI classes are defined in package javax.microedition.xml.rpc (Table 17.4). Those classes correspond to elements in the programming model defined in the WSDL document. The JSR 172 specification implementers must implement them.For more up-to-date documentation and usage examples of the SPI, please refer to the specification documents released by JSR 172. 17.4.1 Support for Gateway-Based ClientsThe SPI is just a set of interfaces. There are many innovative ways to implement it. For example, a vendor can implement most of the SOAP parsing methods on a gateway. The SPI implementation on the client device could communicate with the gateway using optimized proprietary protocols (Figure 17.2. This way, we can reduce the device hardware and bandwidth requirements of mobile Web Services clients. Oracle's J2ME Web Services gateway application server is a step toward this direction. Figure 17.2. Implementing a mobile Web Services gateway using the SPI.![]()
|