使用 JMETER 在击中 WebService 时出现 Soap Fault

Getting Soap Fault on hitting a WebService using JMETER

我正在尝试通过 Jmeter (3.0) 联系网络服务,但出现以下错误:

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
   <s:Body>
      <s:Fault>
         <s:Code>
            <s:Value>s:Sender</s:Value>
            <s:Subcode>
               <s:Value xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</s:Value>
            </s:Subcode>
         </s:Code>
         <s:Reason>
            <s:Text xml:lang="es-AR">The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</s:Text>
         </s:Reason>
      </s:Fault>
   </s:Body>
</s:Envelope>

我在从 SoapUI 联系网络服务时没有遇到任何问题,所以我想知道是什么导致了这个问题。

您可以在此处查看屏幕截图:

树中的 HTTP 请求,HTTP 请求数据的第一部分,HTTP Header 管理器设置:https://i.stack.imgur.com/6HxIK.jpg

以下是 SoapUI 上的结果(工作正常):

Results and log

SoapUI 发送请求的方式是否可能与 Jmeter 不同,这就是它工作的原因?

请帮忙。谢谢!

我认为您在 http header SOAPAction.

的值中有一些小错误

碰巧注意到(在您附上的图片中)它的值中有双引号。
只需从 SOAPAction 值中删除双引号 "

更新:

注意到,在编辑问题时,soapui 发送了一个额外的 http header action 和一个值(您屏蔽了该值)。

因此,请在 jmeter 请求中添加 action header 以及 jmeter 计划中的正确值。

您需要将此 action 位作为 Content-Type header 的一部分,例如:

我还建议将 HTTP Cookie Manager 添加到您的测试计划


出于兴趣,您为什么不使用 JMeter HTTP(S) Test Script Recorder 记录源自 SoapUI 的请求,例如:

  1. 配置 JMeter 进行记录。最简单的方法是使用 JMeter Templates 功能

    • 来自 JMeter 主菜单:File - Templates - Recording - Create
    • Workbench - HTTP(S) 测试脚本记录器 - 开始

  2. 配置 SoapUI 进行录制

    • 从 SoapUI 主菜单:Preferences - Proxy Settings
    • 代理设置:手动,主机:IP地址或JMeter所在机器的主机名运行,端口:8888

  3. 在 SoapUI 中执行请求

  4. 在 Workbench -> Recording Controller 下检查 JMeter 中记录的请求。