<dependency> <groupId>org.amdatu.remote</groupId> <artifactId>org.amdatu.remote.admin.http</artifactId> <version>1.0.0</version> </dependency> public interface GreetingService { String greet(String name); } public class GreetingServiceImpl implements GreetingService { public String greet(String name) { return "Hello, " + name + "!"; } } @Service @Component(provide = GreetingService.class) public class GreetingServiceImpl implements GreetingService { public String greet(String name) { return "Hello, " + name + "!"; } } properties org.amdatu.remote.admin.http.host=127.0.0.1 org.amdatu.remote.admin.http.port=8080 org.amdatu.remote.admin.http.path=/services URL url = new URL("http://127.0.0.1:8080/services/GreetingService"); GreetingService service = ServiceProxyBuilder.createProxy( getClass().getClassLoader(), url, GreetingService.class); String result = service.greet("John"); System.out.println(result);


上一篇:
下一篇:
切换中文