aspose file tools*
The moose likes Web Services and the fly likes SOAP interface, RMI interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "SOAP interface, RMI interface" Watch "SOAP interface, RMI interface" New topic
Author

SOAP interface, RMI interface

Greg Whelan
Ranch Hand

Joined: May 18, 2000
Posts: 52
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?
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Greg Whelan
Ranch Hand

Joined: May 18, 2000
Posts: 52
"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).
Greg Whelan
Ranch Hand

Joined: May 18, 2000
Posts: 52
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...

http://www.onjava.com/pub/a/onjava/2002/04/24/jax-rpc.html
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
IBM has another technology that tries to achieve the same end, but with more pluggability. Take a look at the Web Services Invocation Framework (WSIF).
Kyle
Mandan Happy
Ranch Hand

Joined: Dec 17, 2001
Posts: 65
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SOAP interface, RMI interface