1.创建接口
public interface Test{
public void A();
public String B(String str);
}
2.实现接口
public class TestImpl implements Test{
public void A(0{
System.out.println("Hello");
}
public String B(String str){
return "this is "+str;
}
}
3.发布接口
public static void main(String[] args){
System.out.println("start");
Test testImpl = new TestImpl ();
String address = "http://127.0.0.7/hello"; //接口所在服务器地址
Endpoint.publish(address ,testImpl );
System.out.println("started");
}