springboot项目中调用hession接口
1.增加pom依赖
<dependency>
<groupId>com.caucho</groupId>
<artifactId>hessian</artifactId>
<version>4.0.38</version>
</dependency>
2.springboot启动类代码
@SpringBootApplication
public class TwpWeixinPublicApplication {
@Value("${weixinapi.templateMsg}")
private String templateMsg;
public static void main(String[] args) {
SpringApplication.run(TwpWeixinPublicApplication.class, args);
}
@Bean
public HessianProxyFactoryBean helloClient() {
HessianProxyFactoryBean factory = new HessianProxyFactoryBean();
factory.setServiceUrl(templateMsg);
factory.setServiceInterface(TemplateMsgAPIService.class);
factory.setOverloadEnabled(false);
return factory;
}
}