client端
pom.xml 同server端
application.properties
server.port = 8081
user.java 同server端
userCondition.java 同server端
IHelloService 同server端
主程序(重点.....)
package com;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.remoting.caucho.HessianProxyFactoryBean;
import com.example.IHelloService;
/**
* @功能描述 Hessian实例之客户端
* @author www.gaozz.club
* @date 2018-08-26
*/
@SpringBootApplication
public class HessianClient {
@Bean
public HessianProxyFactoryBean helloClient() {
HessianProxyFactoryBean factory = new HessianProxyFactoryBean();
factory.setServiceUrl("http://localhost:8080/HelloService");
factory.setServiceInterface(IHelloService.class);
return factory;
}
public static void main(String[] args) {
SpringApplication.run(HessianClient.class, args);
}
}
QQ图片20180828184600.png
QQ图片20180828184607.png
QQ图片20180828184755.png
QQ图片20180828184803.png
网友评论