Designing a System Incorporating with JAVA RPC(JAX-WS)…
Web Services
Simply Web Service may be a client-server application so as to speak in between applications over the network. it’s a language independent way of communication.
Web Services can be mainly categorized in to two types as follows,
- SOAP Web Services — Simple Object Access Protocol.
- RESTful Web Services — REpresentational State Transfer.
Java Web Services API
For the developing of Web Services java has defined two main APIs.
- JAX-WS
- JAX-RS
JAX-WS is SOAP Web Services and RESTful Web Services is JAX-RS.There are two ways to develop JAX-WS.
- JAVA RPC style.
- JAVA Document style.
There are two main implementations of JAX-RS.Them are;
- Jersey.
- RESTEasy.
The RPC is compatible for client server interaction flow control over switch between caller and callee.Of course, at an equivalent time the client and the server do not do both.Instead, the death cord jumps from the caller to callee then comes back again.
Now let’s design an easy HelloWorld System incorporating with JAVA RPC. we’ve to make 4 files.
- HelloWorld.java.
- HelloWorldImpl.java.
- HelloWorldPublisher.java.
- HelloWorldClient.java.
HelloWorld.java, HelloWorldimpl.java & HelloWorldPublisher.java was created for server side and client side file HelloWorldClient.java.Application files are as follows…
HelloWorld.java
HelloWorldImpl.java
HelloWorldPublisher.java
HelloWorldClient.java
Now when we are calling from publisher to client output is as follows…
From the above simple HelloWorld example we’ll identify following JAVA RPC concepts.
1. Client calls a neighborhood procedure on the client stub.
2 The client stub acts as a proxy and marshalls the choice and thus the args.
3. The client stub send it to the remote system via TCP/UDP.
4. The server stub unmarshalls the choice and args from the client.
5. The server stub calls to the server for the actual process.
6. The server stub marshalls the answer and sends the response back to the client.
In this post, I have also demonstrated the design of a HelloWorld framework that integrates JAVA RPC with JAVA RPC concepts information.My next post are getting to get on the Invoking methods in between two jvms. Stay Safe.