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