美文网首页
Custom SOAP Sampler 中文乱码问题

Custom SOAP Sampler 中文乱码问题

作者: ling67_ | 来源:发表于2019-10-25 10:41 被阅读0次

修改源码中在com.jmeter.protocol.soap.sampler.CustomSOAPSampler.java文件的函数sample(Entry e)

若request body中文乱码,则在以下位置添加一行代码:

result.setSamplerData(new String(result.getSamplerData().getBytes("gbk"),"utf-8"));

若response data 出现中文乱码,则同样在以上源码函数中,修改

将:result.setResponseData(respContents.getBytes());

改成:result.setResponseData(respContents,"utf-8");

修改完,直接打包为jar文件,覆盖原来的jar包即可

相关文章

网友评论

      本文标题:Custom SOAP Sampler 中文乱码问题

      本文链接:https://www.haomeiwen.com/subject/btqsvctx.html