我试图从下面的XML中检索数据,但我尝试的所有选项都给我空值。有人可以帮助!JMeter XPath Extractor问题
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns8:SearchQuoteResponse
xmlns="http://services.akshay.com/pr/search" xmlns:ns2="http://services.akshay.com/pr/po"
xmlns:ns3="http://services.akshay.com/pr/common"
xmlns:ns4="http://services.akshay.com/pr/fault"
xmlns:ns5="http://services.akshay.com/pr/appointment"
xmlns:ns6="http://services.akshay.com/pr/registration"
xmlns:ns7="http://services.akshay.com/pr/in"
xmlns:ns8="http://services.akshay.com/Services/ws"
xmlns:ns9="http://services.akshay.com/pr/q">
<ns8:responseType>SUCCESS</ns8:responseType>
<ns8:message>Quote Search completed successfully.</ns8:message>
<ns9:Quote>
<ns9:quoteId>72620</ns9:quoteId>
<ns9:quoteResponse>
<ns9:quoteExpiryDate>2013-08-04T10:17:35.000Z</ns9:quoteExpiryDate>
<ns9:listQuoteItemResponse>
<ns9:respQuoteItemId>657222</ns9:respQuoteItemId>
<ns9:lineNumber>1</ns9:lineNumber>
<ns9:afterMarketPartDetails>
<ns3:warrantyType />
</ns9:afterMarketPartDetails>
<ns9:listPrice>153.0</ns9:listPrice>
<ns9:netPrice>61.2</ns9:netPrice>
<ns9:partAvailability>IN</ns9:partAvailability>
<ns9:shippable>Y</ns9:shippable>
</ns9:listQuoteItemResponse>
</ns9:quoteResponse>
<ns9:createdDate>2013-06-20T16:17:34.996Z</ns9:createdDate>
</ns9:Quote>
</ns8:SearchQuoteResponse>
</S:Body>
</S:Envelope>
从上面的SOAP我需要<ns9:respQuoteItemId></ns9:respQuoteItemId>
标签的值,但是XPath的提取总是给我空值。 我曾尝试下面的选项 -
1 - //*[local-name()="respQuoteItemId"]/text()
2 - //*[local-name()='respQuoteItemId' and namespace-uri()='http://services.myportal.com/procurement/q']
3 - //ns8:SearchQuoteResponse/ns9:Quote/ns9:quoteResponse/ns9:listQuoteItemResponse/ns9:respQuoteItemId
我不好,这是笔误,而发布,甚至与标签它给了我Null值:( – Akshay
然后,我不明白为什么该项目没有被找到我建议你检查你的名字空间绑定表达式中使用的前缀。祝你好运! –
只是添加更多我得到下面异常当我尝试第三选项。断言失败消息:前缀必须解析为名称空间:ns8 – Akshay