XPath POSTプロセッサ:SOAP応答からノードの内容を抽出する
質問
この形式の石鹸応答があります
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:Responseto xmlns:ns2="http://xyz.company.com/">
<return>
<objectContent xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">/path/to/file.txt</objectContent>
<objectType>FILEPATH</objectType>
<rid>111</rid>
<sid>2</sid>
</return>
</ns2:Responseto>
</S:Body>
</S:Envelope>
.
XPathアサーションにフィードするために、JMeterのオブジェクトコンテンツを抽出したい。
誰かがこれを行う方法を提案することができますか?
//return/objectType
を試みましたが、DebugSamplerは私の変数の値が空白であることを示します。
解決
-
あなたが言及した応答を持つ要求の子としてXPath extractorを置きます。
-
抽出器を設定する:
"Main Sample" Only "Use Namespaces" checked "Ignore Whitespaces" checked "Return entire XPath fragment instead of text content" Unchecked "XPath query" : //return/objectType
私はそれがうまくテストしました。
所属していません StackOverflow