The problem is still not totally clear.
Are you using both request and response side Copybook DPHs?
Have you configured both request and response side copybook mappings in DevTests copybook mappings XML structure? They are different. It could be that your request side mapping is working, but your response side mapping is not working.
I believe DannySaro approach may still apply.
A normal VSM flow looks like this:
- Listen Step (with Copybook DPH filter)takes stream and converts to XML based on Copybook mappings defined to DevTest.
- VSI Selection creates a response list containing Copybook XML response having {{magic strings}} noted in the VSI response.
- Responder step (with Copybook DPH) converts formatted XML back to stream and applies magic string substitution to {{ }} tagged data. Response is sent on the wire as a stream of data.
In a normal VSM, the VSI selection step above creates the lisa.vse.response property which holds a List of TransientResponse objects. This List of TransientResponses which contain Copybook XML is used internally by DevTest when the Responder step executes. Then the Response Side Copybook DPH is used to convert the response XML back to a stream. <-- This requires a copybook mapping xml definition in DevTest.
But, it seems the VSM is performing its own VSI Selection logic against a Copybook XML request payload. In other words,
- Listen Step (with Copybook DPH filter)takes stream and converts to XML based on Copybook mappings defined to DevTest. Or, you have added custom script logic which takes the lisa_vse_request body String and converts it to Copybook XML using some custom script.
- Additional script logic manipulates the Copybook XML and applies some replacements. This logic DOES NOT appear to be creating a lisa.vse.response containing a List of TransientResponse objects.
- Responder step executes and fails
If the description of the custom VSM above is true, try this.
- Add a VSI selection step to your model after the Listen step.
- In the VSI, leave the operations and signatures blank. In other words create an empty VSI that has no matches.
- In the VSI's Stateless image response, change the MetaData's HTTP-Response-Code to 200, Text to OK, and content-type to an appropriate value.
- By default, when the VSI Selection step executes, DevTest will send back a lisa.vse.response object containing a TransientResponse having the Stateless Image Response Not Found as its body.
After the VSI selection step, execute your custom logic to create a response payload. Then, add some script logic to replace the VSI response body created in the VSI Selection Step with your converted Cobol Copybook content.
[e.g.,
// set your manually manipulated payload into the response body
lisa_vse_response.get(0).setBody( testExec.getStateValue(<yourCopybook>) );
]
This line of script will replace the Stateless Image Response Not Found with the content you are manually creating and manipulating. And, it will do so in a proper lisa.vse.response list with a proper TransientResponse object.
In the Responder Step,
- configure the responder to use lisa.vse.response
- If your custom response contains copybook XML
- Add the proper mappings in the copybook mapping definition file
- Add the Copybook DPH and configuration as a response side filter to allow DevTest to convert the Copybook back to a string response
Else
- if your custom logic has converted the Copybook back to a String already, remove the Copybook DPH from the Response Filters -- your logic converted it from XML back to string so you do not want DevTest to do this.
NOTE: If you are passing Copybook XML to the Response Side DPH, the DPH requires that you have configured the copybook mapping so that DevTest knows which mapping to apply when it converts XML back to string.