Hi,
The server has deployed an RMI-based service using spring remoting.
Is there a specific way for a non-spring client to call these services? Does the client have to look up a specific spring interface ?
Thanks.
Hi,
The server has deployed an RMI-based service using spring remoting.
Is there a specific way for a non-spring client to call these services? Does the client have to look up a specific spring interface ?
Thanks.
This depends on whether the server exposes a traditional RMI service (implementing the Remote interface, declaring RemoteException) or a Spring "RMI Invoker" service (any business interface as service interface).
In the traditional RMI case, simply perform a standard RMI Naming lookup on the client side. There are no Spring specifics involved then.
In the RMI Invoker case, you need to build a Spring-specific RMI proxy like as follows:Code:MyService proxy = (MyService) Naming.lookup("rmi://localhost:1099/myService");
which involves the Spring-specific AOP ProxyFactory and RmiClientInterceptor classes. This is the equivalent of a RmiProxyFactoryBean definition in a Spring application context.Code:RmiClientInterceptor rmiClient = new RmiClientInterceptor(); rmiClient.setServiceUrl("rmi://localhost:1099/myService"); MyService proxy = (MyService) ProxyFactory.getProxy(MyService.class, rmiClient);
Juergen
Hi,
If I have deployed the service via HTTP, would the code from a non-spring client be similar along the lines of the following:
--//--
HttpInvokerClientInterceptor remoteClient = new HttpInvokerClientInterceptor();
remoteClient.setServiceUrl(serviceUrl);
remoteService = (MyRemoteService) ProxyFactory.getProxy(MyRemoteService.class, remoteClient);
--//--
This keeps telling me that it can't find the service at the URL. I'm pretty sure that the service is deployed properly. Any ideas ?
Thanks