junaidgill
6 years agoNew Contributor
Saving contents of a gzipped Http Post request coming into SoapUI
I am receivng a gzipped HTTP Post request in SoapUI. My task is to save the zipped contents into a file using groovy script.
Here is how my groovy script looks like:
import java.nio.file.*
String userDir = context.expand('${projectDir}');
println userDir;
File dir = new File(userDir, "resm");
dir.mkdirs();
File file = new File(dir, "http_post.gz");
file.createNewFile();
Files.copy(new ByteArrayInputStream(mockRequest.requestContent.bytes),
Paths.get( 'http_post.gz') );
It doesn't save any file for me.
Secondly, I don't know where I can see the output of println in SoapUI environment.