-
Sep 24th, 2007, 10:44 AM
#1
Accessing HTTP-remoting service from non-spring client
I have a server-side app assembled using spring, which exposes a service via HTTP-based remoting. However, the clients that access the service may not be configured via spring.
I was wondering if there was a way to retrieve and invoke the service interface from a non-spring client.
(i.e if the service was deployed on the following: http://<server>:<port>/remoting/MyService)
What do I need to do on the client-side to invoke this service ?
Thanks all.
-
Sep 24th, 2007, 02:54 PM
#2
for anyone who is interested, here's the solution:
--//--
HttpInvokerProxyFactoryBean factory = new HttpInvokerProxyFactoryBean();
factory.setServiceUrl(serviceUrl); // set to url where the service is exposed
factory.setServiceInterface(MyRemoteService.class) ;
factory.setHttpInvokerRequestExecutor(new SimpleHttpInvokerRequestExecutor());
remoteService = (MyRemoteService) ProxyFactory.getProxy(MyRemoteService.class, factory);
--//--
3 things must be set - the service url, the service interface class, and most important, the request executor (you can use either the simple http invoker (comes with the jdk), or the apache commons invoker (has some more advanced features).
--//--
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules