Remote Procedure Call (RPC) with java
Introduction:
Remote Procedure Call (RPC) is a protocol that one program can use to request a service from a program located in another computer on a network without having to understand the network’s details. RPC is used to call other processes on the remote systems like a local system. A procedure call is also sometimes known as a function call or a subroutine call. This is similar in many respects to Inter process communication and mainly focus on message based communication schema.
Here is an example code:
There are 04 java files in this project and 03 files for server side and 01 file for client side.
Server side:
01. HiJava.java(Interface)
02. ImplementHi.java
03. publisher.java
Client side:
01. Client.java
HiJava.java (Interface)
ImplementHi.java
publisher.java
After running the publisher code, you can see the generated WSDL file by visiting the URL:
http://localhost:7780/ws/hello?wsdl
Client.java
Output: