How to POST GZip SOAP Request with Apache JMeter

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to POST GZip SOAP Request with Apache JMeter

Taro Suzuki
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;import;
> 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.