Аркадий Булкин
02/21/2024, 1:05 PM{
"priority": 3,
"request": {
"method": "POST",
"urlPath": "...",
"bodyPatterns": [
{
"matchesXPath": "//ns2:message[contains(text(),'ItemCode=\"MIN_PRC_TST_0002\"')]",
"xPathNamespaces": {
"ns2": "...",
"SOAP-ENV": "..."
}
}
]
},
"response": {
"status": 200,
"bodyFileName": "*"
}
}
Request body is almost the same every time (just time and number of request are changing)
Error in WireMock logs:
Warning: failed to evaluate the XPath expression //ns2:message[contains(text(),'ItemCode="MIN_PRC_TST_0002"')]
Do you know how to fix?
P.S. this is not a single failing case. For example xPath "//tem:ProcessMessage[node()][contains(.,'INT_TST_0007')]" sometimes fails the same way.
Thank you.Tom
02/21/2024, 1:43 PMАркадий Булкин
02/21/2024, 1:59 PMTom
02/21/2024, 2:00 PMMatchesXPathPattern:124
and doing a “run until failure”, then you should be able to see the underlying exception that’s causing this.Аркадий Булкин
02/23/2024, 10:19 AMTom
02/23/2024, 10:21 AMАркадий Булкин
02/23/2024, 10:50 AMXmlDocument:57
(evaluating xPath expression) and another thread (e.g. child) is setting another namespace context in XmlDocument:54
. I attached screenshots from debugging where you can see that prefixResolver somehow changing whet it's just passing into constructor without a change. Prefix resolver is an attribute of xPath object.Tom
02/23/2024, 11:08 AMTom
02/23/2024, 11:10 AMАркадий Булкин
02/23/2024, 11:26 AM