The difference between WebService and RMI

quote


The service provided by the Web Service is based on the web container, and the bottom layer uses the http protocol. It is similar to a remote service provider, such as the weather forecast service, which provides weather forecasts to clients around the world. It is a request-response mechanism and is a cross-system and cross-platform of. Is through a servlet, to provide services out.

          First, the client sends the WSDL from the server to the WebService, and at the same time claims a proxy class (Proxy Class) on the client side. This proxy class is responsible for Request and Response with the WebService server. When a data (XML format) is encapsulated into a SOAP format data stream When it is sent to the server, a process object will be generated and the SOAP packet received by the Request will be parsed, and then the transaction will be processed. After the processing is completed, the calculation result will be SOAP-wrapped, and then the packet will be sent as a Response To the client's proxy class (Proxy Class), the proxy class also parses the SOAP packet, and then performs subsequent operations. This is a running process of WebService.
Web Service is roughly divided into 5 levels:
1. Http transmission channel
2. XML data format
3. SOAP encapsulation format
4. WSDL description
5. UDDI UDDI is a directory service that enterprises can use to register Webservices and search

RMI uses stubs and skeletons to communicate with remote objects. The stub acts as the client proxy of the remote object, and has the same remote interface as the remote object. The invocation of the remote object is actually done by calling the client proxy object stub of the object. Through this mechanism, RMI is like it is a local work, using tcp/ip protocol, the client directly calls some methods on the server. The advantage is that it is strongly typed, and errors can be checked at compile time. The disadvantage is that it can only be based on the JAVA language, and the client and server are tightly coupled;
        JRMP is held by Java and is a stream-based protocol that completes an object's Java-to-Java remote call; IIOP It is a protocol for communication between CORBA object request agents, a protocol in Java that enables programs to achieve interoperability with CORBA in other languages, and complements JRMP.
        Advantages: Support distributed objects, cross-platform, stubs/skeletons mechanism; Disadvantages: not cross-language.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326613769&siteId=291194637