Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SOAP interface, RMI interface

 
Greg Whelan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greg Whelan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic