http://www.open-open.com/home/space.php?uid=37924&do=blog&id=8974
1. RMI
Java programmers, for RMI (Remotemethod invoke, remote method calls) must not be unfamiliar, in Java, in order to facilitate the development of distributed applications, the convenience of invoking remote objects, Java provides the RMI API. In RMI, the remote object acts as if it were local, and the client application directly invokes the method on the remote object stub, so it is as convenient to call as a local object. The RMI encapsulates the network transfer of objects and requests, making it possible for remote Object Services to be available directly.
However, the use of RMI must be in an environment where Java code can be identified, that is, the JVM must support it. Therefore, he is only suitable for object communication between Java programs. If you are not working in a Java environment or need to communicate with a non-Java environment, then soap, RPC, Corar, and so on are all possible.
2. RPC & XML-RPC
The difference between RPC (remote method invocation, remote procedure Call) and RMI is obvious, compared to RMI directly get the signature of the remote method, the way to make the call, RPC uses the C/S method, sends the request to the server, waits for the server to return the result.
In order to wrap the RPC request information, the XML-RPC is introduced, and the client sends a specific message that must include the name, the program that runs the service, and the input parameters.
XML-RPC can only use a limited number of data types and some simple data structures. The main work of soap is to use standard XML to describe the RPC request information (uri/class/method/parameter/return value). SOAP, soap is an attractive alternative to heavy-duty paradigms such as CORBA and RMI-IIOP.
3. SOAP
The SOAP message is called a soap Envelope, including the SOAP header and the soap Body. In this case, the SOAP header can easily insert various other messages to extend the functionality of the Web service, such as security (using a certificate to access the Web service), the SOAP body is the specific message body, that is, the information after Marshall.
Some programmers struggle daily with the communication between Perl and C components, C and Java components. These developers can benefit from a shift to a SOAP-based or XML-RPC-based communication model. On the other hand, Java developers who never turn to a language other than Java can turn to RMI instead of using SOAP, and they see great performance improvements.
4. WSDL
WSDL (Web Services Description Language) is a description of the Web service and describes how to access the Web service. WSDL is used to describe soap, in other words, the WSDL file tells you everything you need to know to invoke soap. WSDL is also a section of XML. The WSDL support is now mature for each language, and it is possible to generate a client of its own language based on the same WSDL file.
5. Other
Others are rest, axis, etc.
The following is a comparison of RMI, RPC, and soap
|
Rmi |
Rpc |
Soap |
Communication mode |
The remote object acts as if it were local. Client applications directly invoke methods on remote object stubs |
Instead of calling the method directly, the client sends a request message to the server. |
On XML-RPC, use the specified XML format to communicate with the data format. It is more adaptable than XML-RPC and can support more types and data structures. |
Advantages |
The remote object acts as if it is local, and the compile time can check for errors. |
It allows for greater independence between the client and the server. The server can be completely shut down and replaced without having to let the client know |
Ideal for asynchronous communication and for loosely-coupled clients and servers |
Disadvantages |
Can only be based on the Java language. Exception information is easily lost. The client is tightly coupled with the server. |
The loss of many of the compile-time conveniences ensures that methods and parameters are correct. |
A lot of runtime checks must be done, and developers lose many of the compile-time conveniences that ensure that methods and parameters are correct. |
Transfer RMI, RPC, SOAP communication technology introduction and comparison