How to extract a data from soap (XML) response in Jmeter for next request body

问题描述 投票:0回答:2

我无法从 Jmeter 5.5 中的这个响应中解析 SessionID。

soap jmeter
2个回答
0
投票

我在 xpath 提取器中尝试使用此表达式//GetSessionIDResponse/GetSessionIDResult/SessionID/text(),但无法获得预期的数据。


0
投票

不要发布代码作为图像,否则您的问题将被忽略或者您将得到如下的通用答案:

您需要以某种方式处理 XML 命名空间

假设您有以下 XML:

<?xml version = "1.0"?>
<SOAP-ENV:Envelope
   xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
   SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding">

   <SOAP-ENV:Body xmlns:m = "http://www.example.com/quotation">
      <m:GetQuotationResponse>
         <m:Quotation>Here is the quotation</m:Quotation>
      </m:GetQuotationResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

并想提取

Here is the quotation

选项在:

  1. 使用local-name()函数:

  2. 或者选择 XPath2 Extractor 并在那里指定所有命名空间:

更多信息:在 JMeter 中使用 XPath 提取器

© www.soinside.com 2019 - 2024. All rights reserved.