How can I respond in a Virtual Service with a multipart response that includes a gzip attachment. Are there any examples.
The multipart response with gzip attachment is not supported 'out of the box' in a Virtual Service.
There is an example of how to attach a pdf file to the response on communities:
To develop a solution for the gzip file perhaps consider these suggestions:
First check that you can attach a static text file to a multipart response.
Once you are able to attach a static file to a static response, you can then further customise the response to make it dynamic and change the contents to gzip.
Perhaps by having the gzip file contents prepared in a property and placing the property in the response in the vsi.
It is also possible to use custom code to create the response or modify the response as required with a custom data protocol handler filter.
A strategy for developing code for this, would be to try with different responses, and then logging the entire response from the scriptable data protocol.
This will give an understanding of the structure of the multipart response.
You could then change the whole or part of the response as required within the same scriptable data protocol.
Another option would be to use Wireshark to inspect the live responses.