[Bug] Handling of Binary Data as String in AbstractMockRequest Leads to Data Corruption
When sending binary data (e.g., files with .lzma extension) via POST requests to SoapUI, the handling of the request in AbstractMockRequest (specifically at this line)) ) converts the incoming binary data into a String.
This approach is problematic for binary data, as the conversion process corrupts the data. This issue is evident when trying to save the received data to a file. The problem persists even when using getRawRequestData(), which, instead of returning the original byte array of the request, returns the byte array of the string representation, leading to further corruption.
A potential solution could be to modify the handling in AbstractMockRequest to avoid converting binary data into a String. Instead, it could directly work with the byte array. One approach might be to introduce a new field from around line 151 and utilize this field in getRawRequestData() to return the original binary data.
Hello. I need opened pull request for me.
https://github.com/SmartBear/soapui/pull/806
To rewrite the code to return a byte array method, you will have to rewrite most of the SoapUI core and test its functionality. I may not have studied the code well, but the method definitely expects an xml file, so I added the encoding detection and subsequent conversion to UTF-8 to the code, since there may be files with a different encoding.