The difference between Hessian and WebService

Source: Internet
Author: User
Tags soap wsdl

Hessian:hessian is a lightweight remoting onhttp tool that provides RMI functionality in a simple way, simpler and faster than Webservice,hessian.

The use of the binary RPC protocol, because the use of binary protocol, it is very suitable for sending binary data, Hessian mainly for object-oriented message communication.

Hessian's original intention is to support dynamic types, compact format, and cross-language.  Hessian is a grouping and anti-grouping implemented using its own serialization mechanism, which supports data types that are limited and do not support complex objects that can penetrate firewalls. I have to say here. Rmi:rmi is a set of APIs for users to develop distributed applications. He uses the Java serialization mechanism to implement calls and to group the return values in an anti-marshalling. It uses the Java language interface to define the remote object, which aggregates the Java serialization and Java Remote Method Protocol (Java Protocol). He can be seen as the Java version of RPC, because traditional RPC does not apply well to distributed object systems. Java RMI supports communication between program-level objects stored in different address spaces, enabling seamless remote calls between remote objects.     He also has its shortcomings, he can only through the RMI protocol access can not be accessed through the HTTP protocol, unable to penetrate the firewall. There is also a remote invocation method that is Httpinvoker: He also groups and deserializes parameters and return values through the Java serialization mechanism, which has the benefits of RMI supporting all serializable objects. The use of the HTTP protocol to transmit binary streams, while having Hessian, Burlap (transfer XML text) advantages.

Hessian: Write a question that Hessian need to be aware of:

1. The Java server side must have the following points:

Jar Package with Hessian

Design an interface that is used to call the client

Realize the kinetic energy of this interface

Configure Web. XML to configure the appropriate servlet

Object must implement Serializable interface

For complex objects, you can use map methods to pass

2, the client must have the following points:

Java Client contains Hessian.jar package

Has the same interface and entity classes as the server-side structure. including namespaces are best.

Advantages of Hessian:

1-The entire jar is small, more than 200 K, 3.1 version of, of course, I downloaded the for Java version.

2-Configuration is simple, basically do not need to spend any experience to configure it

3-powerful, can throw soap away, also can put EJB aside, adopt binary to pass object

4-With multiple language support, Python C + +. NET and even flex can be used as client side

WebService Introduction

(1) WebService is an SOA (Service Oriented Programming) architecture, it is not dependent on the language, does not rely on the platform, can be implemented in different languages of the mutual invocation, through the Internet for HTTP protocol-based network applications between the interaction.
(2) WebService implementation of different language calls, is based on a standard, WebService is required to comply with the WSDL (Web Service Definition Language)/soap (Simple request Protocol) specification.
(3) Webservice=wsdl+soap+uddi (registration of WebService), soap is composed of part and 0 or more attachments of soap, usually only part, in which there is envelope and body.
(4) Web service is an SOA architecture that allows different programs to be integrated by providing standard protocols and interfaces.


Advantages of WebService

(1) Allows heterogeneous programs to access each other (cross-platform).
(2) Loose coupling.
(3) Based on standard protocol (common language, allow other programs to access).

Disadvantages of WebService:
(1) WebService uses XML to encapsulate data, resulting in large amounts of data to be transmitted over the network.
(2) The WebService specification does not specify any implementation-related details, including the object model, programming language, which is less than CORBA.


The basic principle of WebService

(1) Service provider uses WSDL description services.
(2) Service Provider uses UDDI to publish the services ' profiles to the UDDI server (Register server).
(3) Service requestor queries and obtains the WSDL file on the UDDI server.
(4) Service requestor binds the request to soap and accesses the appropriate service.

Reference Link: http://blog.csdn.net/jaryle/article/details/52314072

The difference between Hessian and WebService

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.