Announcement Announcement Module
No announcement yet.
Accessing HTTP-remoting service from non-spring client Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #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).