JMeter-删除SOAP请求中的空元素 [英] JMeter - Remove empty elements in SOAP request

查看:125
本文介绍了JMeter-删除SOAP请求中的空元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CSV数据集配置来填充SOAP/XML变量以在JMeter中进行请求.我的问题是,当某些变量为空时,我会因此而导致验证错误,因此我需要摆脱这些错误.

I am using CSV Data Set Config to fill SOAP/XML variables to request in JMeter. My problem is, when some variables are empty, then i get error on validation caused by this so I need to get rid of those.

有一个非常相似的主题,描述得很好( Jmeter删除SOAP/xml reqeust中的空字符串),不幸的是,该解决方案不适用于我,我得到了:

There is very similar topic, well described (Jmeter remove empty strings at a SOAP/xml reqeust), unfortunately the solution is not working for me, iam getting:

meter.util.BeanShellInterpreter:调用bsh方法时出错: eval源文件:内联评估:``字符串数据= sampler.getXmlData();数据= data.replaceAll(","); . . . '':类型变量声明:方法调用中的错误:方法 在以下位置找不到getXmlData() class'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy'

meter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String data = sampler.getXmlData(); data = data.replaceAll("",""); . . . '' : Typed variable declaration : Error in method invocation: Method getXmlData() not found in class'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy'

推荐答案

假定的参考答案 SOAP/XML-RPC请求,您正在使用 HTTP请求,因此需要对请求数据进行一些不同的处理.

The referenced answer assumed SOAP/XML-RPC Request, you're using HTTP Request so request data needs to be manipulated a little bit differently.

更改行:

String data = sampler.getXmlData();

收件人:

String data = sampler.getArguments().getArgument(0).getValue();

再次,我鼓励您熟悉如何使用BeanShell: JMeter的收藏的内置组件"指南.

Again I encourage you to get yourself familiarised with How to Use BeanShell: JMeter's Favorite Built-in Component guide.

这篇关于JMeter-删除SOAP请求中的空元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆