How to dynamically respond to TCP RAW HEX format messages in VSI.
Something in the input request needs to be available for your VSI to determine which response to send. In the graphic you attached, we see an operation called Request, but we do not see any input arguments. I would guess that your request is binary as well after looking at the response. Do you have any input request arguments that you can compare on in order to determine which binary response you want to send?
If you have no arguments on the incoming request, your options may be limited to doing something like:
A. using a match style of signature with allow duplicate responses. Set up several duplicate specific transactions each having a different binary response. This would let the VSI send different responses in a round robin pattern. But, it means that each binary response has no correlation to its paired request -- it is really random.
B. create a DPH that can parse the bytes on the incoming request and create argument fields for the VSI to use to determine which response to send.
C. You might play with the Opaque DPH and see if it can help. I am not sure in this case though.
Judging from the response in your graphic, I doubt that editing the binary response is going to work for you. It appears that your response begins with a record descriptor word (RDW) having a length (x'0000A8'). Additionally, the response is binary because the response contains values that are outside of the ASCII character set range (for example, low-values or x'00' is not a valid ASCII character).
My guess is that this response content is some sort of variable length, mainframe EBCDIC formatted data.
If you want to be able to edit the data inside the response using things like magic string notation, you will need to come up with a technique for stripping out all the non-ASCII characters leaving the data you want to edit and use a response side DPH to 'rebuild' the response to include the proper HEX and ASCII characters, including the RDW on the front indicating the length of the response after it has been edited in the VSI or, at runtime, after magic string processing occurs.
Retrieving data ...