I've been looking at samples from Apache SOAP (2.2) and I've been surprised that the API does not attempt to mimic the RMI interface. I'd like to be able to take a piece of code that uses RMI and allow the remote call to be replaced with a SOAP implementation. If the SOAP client code implemented MyRmiInterface, this would be possible. But from my initial look at Apache SOAP it appears that I'd need to create the adapter myself (for example, so that any SOAP exception is translated into a java.rmi.RemoteException). While this is not a lot of effort, and I could automate it, I'm just surprised that this is not the default interface used by Apache SOAP for Java. Anyone know why this is the case? Do any other SOAP for Java implementations utilize RMI-like interfaces?
Lots of SOAP implementations (but mostly add-ons) use the Proxy pattern like RMI does. For instance, the IBM WSTK (available at www.alphaworks.ibm.com) includes proxy generators that will generate a proxy and a web service deployment descriptor for any arbitrary Java bean. The Sun Web Services Development Pack does similiar things. On the other hand BEA's tool takes an approach very much like the Microsoft .NET approach and uses additional information in the code itself to know how to generate a proxy and web service. Kyle
"Proxy pattern" is a much better way to describe one aspect of what I'd like to see. Thanks for the references Kyle, I'll have to check them out. In addition to the proxy approach, do they also generate stubs which implement a remote interface? The code annotation approach is interesting... I'm still trying to erase my RMI-like expectations to decide which approach I prefer (remote interface driven, or class-annotated driven).
Joined: May 18, 2000
It turns out there's an article published on the O'Reilly Network that discusses using Sun's JAX-RPC, which appears to achieve precisely the RMI/SOAP transparency I'm looking for...
It doesnt makes sense me to convert a RMI interface to a Web service. Why Should Apache provide it. Why should a RMI interface be the base? RMI allows both *data* and *behavioural* transfer,supports DGC,Activation and Call Backs. SOAP is a simple protocol which allows only data transfer. Those implementations that doesnt use RMI interfaces such as MindELectric GLUE makes more sense to me. Thanx -Mandan