TCP Virtual Service Properties

Applies to ReadyAPI 3.57, last modified on December 18, 2024

TCP virtual APIs (virtual services) have a set of properties similar to those of other virtual services. To view or change them, select your service in the Navigator panel. You will see the properties in the right part of the ReadyAPI window and in the bottom-left corner of the Navigator panel:

Service virtualization and API testing: Properties of the TCP virtual service

Click the image to enlarge it.

Properties on the Right

The properties are organized into several groups.

Info

Property Description
Location The computer where the virtual service resides.
Time running The duration of the service run. 0 if the virtual service is not running.
Status Indicates whether the virtual service is running.
Received The number of incoming requests (including those requests for which the service has no virtual operations).
Sent The number of responses the virtual service sent to clients.
Port The port number the virtual service will use for the run. Also, view and change it in the property list in the Navigator panel.
Always assign a separate port for TCP services, otherwise ReadyAPI will not launch such a service along with with other services on the same port. To start your service from the command line, use the -m argument to specify another port.
Virtual service socket The basic socket you can use to access the virtual service.
Autostart on server Commands the virtual service to start automatically right after you deploy it to a remote computer.
Enable SSL Commands the virtual service to always work through secured connections.

Request Delimiter

The delimiter that the TCP virtual service uses to recognize requests in the incoming data stream. Possible values are –

  • Char/Byte sequence – A specific set of bytes or characters. For example, if 3B is the request delimiter and hexadecimal is the code type, the TCP virt splits the following hexadecimal data stream into 3 separate requests:

    62 72 61 76 65 3B 20 6E 65 77 3B 20 77 6F 72 6C 64

    Once the service finds 3B, it identifies all the bytes before the delimiter as request data, and starts listening for another request.

    Tip: To learn about the editor displayed for the option, see the TCP Virtual Service description.
  • Fixed length – The maximum length of the request message, in bytes.

  • Groovy script – The script you can write to create your own segment processing scenario. See Virtual Service Scripting for information on writing scripts and on the available script objects.

  • Segment forwarding – If selected, the service treats each TCP segment as a separate request.

Note: Don’t include the request delimiter character into request data when you are editing virtual requests of the TCP virtual service. Doing this will cause incorrect request recognition. For more information on the delimiter role, see Request and Response Dispatching.

Response Delimiter

The delimiter that the TCP virtual service uses to separate responses in the data stream it sends. See Request and response dispatching. Possible values are –

  • Char/Byte sequence – A specific set of bytes or characters. For example, if 3B is the response delimiter, hexadecimal is the code type, and the response is 62 72 61 76 65, the TCP virt will dispatch the following hexadecimal data stream:

    62 72 61 76 65 3B

    The service automatically appends 3B to the response data, so the client can identify the response bounds properly.

    Tip: To learn about the editor displayed for the option, see the TCP Virtual Service description.
  • Fixed length – The maximum length of the response message, in bytes.

  • Groovy script – The script you can write to create your own response sending scenario. See Virtual Service Scripting for information on writing scripts and on the available script objects.

  • Segment forwarding – If selected, the service treats each TCP segment as a separate response.

Note: Don’t include the response delimiter character into response data when you are editing responses of the TCP virtual service. The service automatically appends this delimiter to responses it sends. For more information, see Request and Response Dispatching.

Description

Arbitrary text describing your TCP virtual service. This is the same text you can view and change in the property list in the Navigator.

Start Script

The script that is executed right after the virtual service starts. For information on writing scripts and on the available script objects, see Virtual Service Scripting.

Stop Script

The script that is executed right before the virtual service stops. See Virtual Service Scripting for information on writing scripts and on the available script objects.

OnRequest Script

The script that is executed right after the virtual service receives an incoming request.

Note: The script is executed for all the requests, including those for which your service has no virtual operations.

See Virtual Service Scripting for information on writing scripts and on the available script objects.

AfterRequest Script

The script that is executed after the virtual service replies to the incoming request.

Note: The script is executed for all the requests, including those for which your service has no virtual operations.

See Virtual Service Scripting for information on writing scripts and on the available script objects.

Properties in the Navigator

TCP Virtual Service Properties Page

Common
Property Description
Name The virtual service name.
Description Arbitrary text describing the virtual service. Also, view and change it in the property editor in the right part of the product window.
Port The port number the virtual service will use for the run. Also, check and edit this value in the editor in the right part of the product window.
Always assign a separate port for TCP services, otherwise ReadyAPI will not launch such a service along with with other services on the same port. To start your service from the command line, use the -m argument to specify another port.

Custom TCP Virtual Service Properties Page

On this page, you can create, delete, edit and view user-defined properties for the virtual service. You can also see and change these properties in the property editor in the right part of the product window (in the Properties section).

The toolbar above the property list contains commands for creating and deleting properties, changing their order, sorting, clearing property values, and loading property values from and saving them to a file.

Specific to TCP Service
Property Description
tcpMockService.port The port number the virtual service will use for the run.
tcpMockService.routeModeEnabled If true, the virtual service redirects requests to the service specified in the tcpMockService.targetSocket property. If false, the service tries to respond with the recorded requests.
tcpMockService.routeUnmatchedOperation Requires that tcpMockService.routeModeEnabled be set to true.
If true, the virtual service redirects only the requests that do not exist in the service. If false, the service redirects requests as the tcpMockService.routeModeEnabled property specifies.
tcpMockService.addUnmatchedOperation Requires that tcpMockService.routeModeEnabled and tcpMockService.routeUnmatchedOperation be set to true.
If true, the virtual service records redirected requests and adds them to the service. If false, the service requests are redirected as other parameters specify, and the service is not changed.
tcpMockService.targetSocket The socket of the real service the virtual service redirects requests to.
tcpMockService.requestDelimiterType The type of the request delimiter.
tcpMockService.requestDelimiterType The request delimiter itself if the selected type requires some input.
tcpMockService.responseDelimiterType The type of the response delimiter.
tcpMockService.responseDelimiterType The response delimiter itself if the selected type requires some input.
tcpMockService.useSSL If true, the virtual service is accessible only through secured connections. If false, the service also handles non-secured requests.

See Also

Reference
TCP Virtual Services

Highlight search results