Hessian requests

Hessian is a binary web service protocol developed by Caucho Technology, Inc. It allows remote procedure calls to be executed between the client and server, using the standard Hessian RPC (Remote Procedure Call) communication or specific Frameworks such as Spring Remoting (Spring HTTP Invoker). The data exchange is carried out in binary and encapsulated in the HTTP protocol.

The Hessian module allows load testing web applications programmed in Java and using the standard Hessian RPC communication or specific Frameworks such as Spring Remoting (Hessian).

NeoLoad 8.2 supports Hessian 1.0 and 2.0 protocol.

Note: To be able to handle Hessian requests, you will need to purchase the optional Java Serialization module. This module is included in the demo version of NeoLoad.

Note: Hessian module supports only RPC communication over HTTP.

Dependent libraries

When recording Hessian requests, you will need to load the Java classes for the objects exchanged, as well as the client interfaces for the called services. For more information, see Hessian

Recording

The following diagram shows how the Hessian module works during recording:

The binary data exchanged between the client and server passes through the recording proxy. The Hessian module comes into play as the data travels through the proxy, analyzing and decoding the requests. Once translated into XML, the requests are inserted in the project.

Note: Only requests with the Content-Type: x-application/hessian or application/x-hessian headers are recorded.

Runtime

The following diagram shows how the Hessian module works during a test run:

The XML request variables are evaluated and the module engine translates the XML to binary data. This data is then sent to the server. The binary response received is translated into XML, after which the validity checks and Variable Extractors in the played request are executed.

Record a Hessian request

This section describes how to record the interaction between an existing Java client and the server.

To record a Hessian request, follow these steps: 

  1. Change the Java client settings so that it uses NeoLoad as a proxy:

    • hostname: host name or IP address of the machine with running NeoLoad.

    • port: the HTTP recording port used by NeoLoad, default is 8090. This setting may be changed in Preferences.

      • For a Java applet application: No modifications are required to record Hessian requests.

      • For a Java application using JNLP: Configure the Java settings:

      Open the Java settings in the Windows control panel.

      Select the General tab, and click on the Network settings button.

      Select Use proxy server and set the machine name as localhost and the NeoLoad proxy port (default is 8090)

      Validate these settings and re-start your Java application before making a new recording.

      • For a standalone Java application: Configure the http.proxyHost and http.proxyPort system properties.

      For example, place the following code in your code:

      System.setProperty("http.proxyHost", "localhost");

      System.setProperty("http.proxyPort", "8090");

      or modify the command line:

      java -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8090 ...

  2. Launch NeoLoad.

  3. Begin a recording. Since a standalone Java application does not require a browser, it is recommended to clear the Launch browser check box. For more information, see Record a test scenario.

  4. Launch the Java client. If everything is working correctly, the HTTP requests sent by the Java application should be visible in NeoLoad.

  5. Stop recording.

Post-recording wizard

At the end of recording, the JAR declaration panel is displayed if any Java classes or JAR files are missing:

All the classes for the Java objects exchanged between the client and server, as well as the JARs for the Framework used to transport the customized Java objects must be loaded.

This panel only displays part of the missing classes; not all the missing classes can be resolved.

To declare the missing Hessian libraries (JAR files), follow these steps:

  1. Open the file explorer by clicking the + button.

  2. Select an appropriate WAR file for the application, or the directory containing the deployed web application, then click Select. NeoLoad automatically retrieves the required JAR files from the selected application. You also may select the JAR files to be loaded manually in NeoLoad. Repeat the operation as many times as is necessary.

  3. A message confirms the declaration. If the operation fails, make sure that all the required Hessian libraries have been declared.

When the libraries have been successfully declared, the following screen appears

Declaring the Hessian libraries at the end of recording is a compulsory step if all the requests are to be played back.

  • You may declare missing Hessian libraries at a later stage.

  • Declaring Hessian libraries is carried out in the project's Hessian libraries manager in the project preferences. For more information, see Hessian

Hessian requests with missing Hessian libraries are identified by a warning symbol: