Java Implementation Hessian Interface test

Source: Internet
Author: User

Hessian interface Test Simple single case

Hessian is based on the BINARY–RPC (binary remote Procedure Call protocol) for communication.

Hessian is to convert the Java object into a sequence of bytes, and then through the HTTP transmission to the target server (host), the host receives this sequence of bytes, according to a certain protocol standard to reverse the sequence, submitted to the corresponding service processing. The data is returned in the same way after processing is complete.

Environment Preparation:

Eclipse

Hessian.jar

API package for the tested interface

Interface request address (with port number)

Interface Documentation Description

Interface Service-Side open

First, parameter Settings

Request parameters as defined by the interface document:

Instantiate a request (Csnumrequest) object (a defined interface request class in the interface API):

Set the value for the Csnumrequest object:

Set a value for the parameter by calling the method above

Second, initiating a request

Write a method to impersonate the client to invoke the remote interface (based on the interface documentation to obtain the request service class and method: Csremoteservice and the method Queryarea):

Such as

Third, Get return results

Instantiate a return object (a defined interface in the interface API returns a class):

The interface return parameters are as follows:

Get the return parameters in the following ways:

That ' s all!!!

Java Implementation Hessian Interface test

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.