import org.jboss.remoting.Client;
public class MyClient {
public static void main(String[] args) {
try {
Client client = new Client("http://localhost:8080");
Object result = client.invoke("sayHello", "John");
System.out.println("Server Response: " + result);
} catch (Exception e) {
e.printStackTrace();
}
}
}
import org.jboss.remoting.Server;
public class MyServer {
public static void main(String[] args) {
try {
Server server = new Server();
server.register("sayHello", new HelloWorldServiceImpl());
server.start();
} catch (Exception e) {
e.printStackTrace();
}
}
}