【发布时间】:2017-06-19 09:18:57
【问题描述】:
我正在使用 xpath 提取器从肥皂响应中提取特定值并使用 Beanshell 后处理器写入 csv 文件,但在这里,我面临的问题是我需要来自肥皂响应的多个值。
请任何人提供如何使用xpath提取器从soap响应中提取多个值并将其保存在单独的变量中并写入csv文件。
例如:
肥皂反应:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ValidateCardResponse xmlns="http://service.clp.eks.com">
<out>
<birthDate xmlns="http://wsform.clp.eks.com">01-01-73</birthDate>
<cardno xmlns="http://wsform.clp.eks.com">23016077</cardno>
<customerName xmlns="http://wsform.clp.eks.com">gopi</customerName>
<flag xmlns="http://wsform.clp.eks.com">TRUE@19@FALSE</flag>
<memberLevel xsi:nil="true" xmlns="http://wsform.clp.eks.com"/>
<points xmlns="http://wsform.clp.eks.com">43292.65</points>
<reason xmlns="http://wsform.clp.eks.com">SUCCESS</reason>
</out>
</ValidateCardResponse>
</soap:Body>
</soap:Envelope>
我需要两个参数来为每条记录保存在 csv 文件中,即积分和原因,因为万一卡无效,那么原因将随着卡无效而出现。 请提供如何执行此操作,如果我使用两个 xpath 提取器,那么我会收到错误消息。
【问题讨论】: