You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Taro Suzuki <ce...@gmail.com> on 2020/07/01 03:36:29 UTC

How to POST GZip SOAP Request with Apache JMeter

Dear all,

I used JMeter 5.3.

I added a JSR223 PreProcessor as a child of the request which needs to be
encoded, and I defined the following script:
>
> import org.apache.commons.io.IOUtils;import java.util.zip.GZIPOutputStream;
> String bodyString = sampler.getArguments().getArgument(0).getValue();byte [] requestBody = bodyString.getBytes("UTF-8");
> ByteArrayOutputStream out = new ByteArrayOutputStream(requestBody.length);GZIPOutputStream gzip = new GZIPOutputStream(out);
> gzip.write(requestBody);
> gzip.close();
> sampler.getArguments().getArgument(0).setValue(out.toString("UTF-8"));
>
>  And I Started My TestPlan and I captured packets with WireShark.
When I checked the post request, the post request started with "1F EF BF BD
08 ......".
As a result, I received "500 Internal Server Error".

What should I do to resolve this issue?

Thank you and best regards.