引用的答案假定为SOAP / XML-RPC
Request,您正在使用HTTP
Request,因此需要对请求数据进行一些不同的处理。
更改行:
String data = sampler.getXmlData();
至:
String data = sampler.getArguments().getArgument(0).getValue();
我再次鼓励您熟悉如何使用BeanShell:JMeter的“最喜欢的内置组件”指南。

引用的答案假定为SOAP / XML-RPC
Request,您正在使用HTTP
Request,因此需要对请求数据进行一些不同的处理。
更改行:
String data = sampler.getXmlData();
至:
String data = sampler.getArguments().getArgument(0).getValue();
我再次鼓励您熟悉如何使用BeanShell:JMeter的“最喜欢的内置组件”指南。