Announcement Announcement Module
Collapse
No announcement yet.
Run HttpInvoker without config file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Run HttpInvoker without config file

    Hello all, I'm trying to run an application to bench a call to HttpInvoker.
    I'd like to run spring without config file to minimize the startup time. It should as fast as an EJB call.

    So here is my test:
    Code:
    HttpInvokerProxyFactoryBean ht = new HttpInvokerProxyFactoryBean();
        ht.setServiceUrl("http://192.168.X.X:8080/XXX/Services/XXX");
        ht.setServiceInterface(MyClass.class);
        HttpInvokerClientConfiguration htC = new HttpInvokerClientConfiguration()
        {
    
          public String getServiceUrl()
          {
            return "http://192.168.X.X:8080/XXX/Services/XXX";
          }
    
          public String getCodebaseUrl()
          {
            return null;
          }
        };
    
        RemoteInvocation remo = new RemoteInvocation();
        RemoteInvocationResult reqR = ht.getHttpInvokerRequestExecutor().executeRequest(htC, remo);
    
        final IMyClass myClass = (IMyClass)reqR.getValue();
    myClass is null so I think this object RemoteInvocation should be defined precisely but I don't know how.
    Any idea about how I can do this?

    Thank you

  • #2
    Well ok I've found the solution, I've had to call on more method to change the state of the factory bean : "afterPropertiesSet();";
    So here is the code:

    Code:
        HttpInvokerProxyFactoryBean ht = new HttpInvokerProxyFactoryBean();
        ht.setServiceUrl("http://192.168.X.X:8080/XXX/Services/XXX");
        ht.setServiceInterface(MyClass.class);
        ht.afterPropertiesSet();
        final IMyClass myClass = (IMyClass)ht.getObject();
    ... do some stuff with my class
    some usefull links:
    http://stackoverflow.com/questions/1...url-at-runtime

    http://www.eclipse.org/forums/index.php/m/739454/

    http://static.springsource.org/sprin...ctoryBean.html

    Comment

    Working...
    X