Search code examples
javaspringspring-remoting

Spring HTTP Invoker usage


What are the important motivations for upgrading from EJB2.0 remoting to Spring remoting using HTTPInvoker? The one that I found was that in EJB2.0, the client code has to do jndi lookups and on the server side, we need to write extra classes and interfaces(remote,home). In Spring HTTPInvoker, we just configure the remote EJB bean as a service and we are good to go. Just wondering if there are other benefits except this one. If this is the only benefit, how to decide whether to go for web services or HTTPInvoker?


Solution

  • Spring's HTTPInvoker is a very simple RPC-over-HTTP mechanism, using standard java serialization. If that meets your requirements, then by all means use it.

    However, it falls a long way short of EJB-style remoting, which as well as being more efficient (HTTP remoting is not very performant), adds facilities such as transactions and security. Both of these can be provided by Spring, but it means additional wiring and configuration.

    As far as deciding between HTTPInvoker and proper Web Services, the former is highly proprietary (both ends must be Spring), and tightly couples the client with the server (they have to be serialization-compatible). Proper web-services are standards-compliant and client-agnostic (if done properly).