A customer wanted to send a SOAP request to a VS with an attached binary MTOM jpg file and then save the file. The jpg file appeared to not be treated as binary and was changed.
It took some time to develop the code in a script step to extract the jpg file from the request and save as a file but eventually this succeeded.
The pitfall was this line (where DevTest converted everything to text):
ByteArrayDataSource bads = new ByteArrayDataSource(testExec.getStateString("lisa.vse.http.current.transaction",""), "application/xop+xml" ) ;
The correct way is to get the RAW inbound payload:
ByteArrayDataSource bads = new ByteArrayDataSource(testExec.getStateObject("lisa.vse.http.current.transaction.raw"), "application/xop+xml" ) ;
The developer was happy to share the script step code.