Previous Topic: Record JCo IDocNext Topic: SSL with VSE Recording


Opaque Data Processing

Opaque Data Processing (ODP) allows CA Service Virtualization to virtualize data in sufficient detail when the format of the requests and responses is not known. ODP eliminates the need for a new data handler every time you encounter a new message format.

By recording several requests and corresponding responses, CA Service Virtualization can infer the message structure. This means CA Service Virtualization is able to correlate bytes in a request to corresponding bytes in a response, giving the same "magic string" behavior that is available in other protocols. CA Service Virtualization is also able to sufficiently understand the request structure to intelligently match new requests that are encountered when the virtual service is played back.

Underneath, ODP uses a patented algorithm to compare an incoming request to all of the requests in the recorded ODP service image. The closest matching request is selected, and the corresponding response is returned, after performing a dynamic magic string substitution.

The ODP matching algorithm applies entropy-derived weights during the matching process. The entropy weighting process infers which bytes in the message are more important. For example, which correspond to the operation type, as opposed to the rest of the payload, and gives those bytes a greater importance during the matching process. The entropy weighting process works best with larger samples of recorded messages (100 or more) and with a diverse sampling of parameter values.

The ODP matching and response algorithm has been shown to work on both binary and textual message protocols. The best results have been obtained with protocols that use fixed width fields (such as IMS) or delimited fields (such as XML-based protocols). Reasonable accuracy has also been obtained with length-encoded protocol formats (for example, ASN.1), but these pose the greatest challenge.

ODP is supported for traffic that can be captured using raw TCP/IP sockets. The data can also be imported from a PCAP file.

How to Use ODP

Use the following instructions for recording a virtual service image using ODP.

For more information about prerequisites and preparatory steps, see Preparing to Virtualize TCP.

Follow these steps:

  1. Open DevTest Workstation.
  2. To start recording a new virtual service image, complete one of the following steps:

    The Virtual Service Image Recorder opens.

  3. Complete the Basics tab as in the following graphic:

    Basics tab on the VS Image Recorder for ODP

  4. Click Next.
  5. Enter the information for both the client and the server, select your encoding, and add SSL parameters.

    Client and Server Data for ODP

    Listen/Record on port

    Defines the port on which the client communicates to DevTest.

    Target host

    Defines the name or IP address of the target host where the server runs.

    Target port

    Defines the port number that the server is listening on.

    Treat request as text

    Specifies whether the request is treated as text. For more information, see Preparing to Virtualize TCP.

    Request Encoding

    Lists the available request encodings on the machine where DevTest Workstation is running. The default is UTF8.

    Treat response as text

    Specifies whether the response is treated as text. For more information, see Preparing to Virtualize TCP.

    Response Encoding

    Lists the available response encodings on the machine where DevTest Workstation is running. The default is UTF8.

    Use SSL to server

    Specifies whether DevTest uses HTTPS to send the request to the server.

    • Selected: DevTest sends an HTTPS (secured layer) request to the server.

      If you select Use SSL to server, but you do not select Use SSL to client, DevTest uses an HTTP connection for recording. DevTest then sends those requests to the server using HTTPS.

    • Cleared: DevTest sends an HTTP request to the server.
    Use SSL to client

    Specifies whether to use a custom keystore to play back an SSL request from a client. This option is only enabled when Use SSL to server is selected.

    Values:

    • Selected: You can specify a custom client keystore and a passphrase. If these parameters are entered, they are used instead of the hard-coded defaults.
    • Cleared: You cannot specify a custom client keystore and a passphrase.
    SSL keystore file

    Specifies the name of the keystore file.

    Keystore password

    Specifies the password associated with the specified keystore file.

  6. Click Next to start recording.

  7. When your recording is complete, click Next.

    ODP relies on the request body, rather than operation and arguments, for matching. Therefore, most request data protocols are not appropriate.

    Response data protocols, on the other hand, are appropriate if the response is encrypted, compressed, or otherwise encoded.

  8. The recorder attempts to detect message delimiters that tell DevTest when it has read a complete request or response. Confirm, or correct, these delimiters on this screen.

    Note: A Request delimiter is mandatory. A Response delimiter must be selected for Live Invocation to be available.

  9. After recording, the recorder verifies request and response bodies to ensure that, if they are marked as text, that they are actually text. If they are not, the type is switched to binary.