HttpInvokerProxyFactoryBean的方式访问项目暴露出的接口首先配置bean
@Bean public HttpInvokerProxyFactoryBean repositorySky(){ HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean=new HttpInvokerProxyFactoryBean(); httpInvokerProxyFactoryBean.setServiceUrl(serviceUrl); httpInvokerProxyFactoryBean.setServiceInterface(ICheckInService.class); return httpInvokerProxyFactoryBean; }
在使用的时候注入对应的类则行了 :
@Autowired ICheckInService iCheckInService;
注意:在配置隐式注入的时候不能写在调用接口的类一起,可写在启动类上