Package proj.zoie.perf.client

Source Code of proj.zoie.perf.client.ZoieClient

package proj.zoie.perf.client;

import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;

import proj.zoie.service.api.SearchRequest;
import proj.zoie.service.api.SearchResult;
import proj.zoie.service.api.ZoieSearchService;

public class ZoieClient {

  /**
   * @param args
   */
  public static void main(String[] args) throws Exception{
    final HttpInvokerProxyFactoryBean factoryBean = new HttpInvokerProxyFactoryBean();

      factoryBean.setServiceInterface(ZoieSearchService.class);
      factoryBean.setServiceUrl("http://localhost:8888/zoie-perf/services/ZoieService");
      factoryBean.afterPropertiesSet();

      final ZoieSearchService svc = (ZoieSearchService) (factoryBean.getObject());
     
      SearchRequest req = new SearchRequest();
     // req.setQuery("java");
      SearchResult res = svc.search(req);

      System.out.println("hits: "+res.getTotalHits()+" time: "+res.getTime());
  }

}
TOP

Related Classes of proj.zoie.perf.client.ZoieClient

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.