У меня есть SOAP-запрос, подобный этому
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://request.com" xmlns:dto="http://dto.com">
<soapenv:Header/>
<soapenv:Body>
<req:requestInput>
......
<dto:correlationId>${=UUID.randomUUID().toString().replaceAll("-", "").toUpperCase().substring(0, 16);}</dto:correlationId>
......
</req:requestInput>
</soapenv:Body>
</soapenv:Envelope>
и ответ SOAP для вышеуказанного запроса похож на
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:res="http://response.com" xmlns:dto="http://dto.com">
<soapenv:Header/>
<soapenv:Body>
<res:responseOutput>
......
<dto:correlationId>539A708FA1B44490</dto:correlationId>
......
</res:responseOutput>
</soapenv:Body>
</soapenv:Envelope>
И это мое утверждение XPath Expression:
declare namespace env="http://schemas.xmlsoap.org/soap/envelope/";
declare namespace req="http://request.com";
declare namespace res="http://response.com";
declare namespace dto="http://dto.com";
//res:responseOutput/dto:correlationId/text()
Ожидаемое значение:
${Request#//req:requestInput/dto:correlationId/text()}
Ошибка:
XPathContains comparison failed for path [
declare namespace env="http://schemas.xmlsoap.org/soap/envelope/";
declare namespace req="http://request.com";
declare namespace res="http://response.com";
declare namespace dto="http://dto.com";
//res:responseOutput/dto:correlationId/text()], expecting [6F37EA93D0454E67], actual was [539A708FA1B44490]
Я хочу проверить, возвращается ли значение, переданное в идентификаторе корреляции в запросе SOAP, в ответе или нет.
Когда этот тестовый пример выполняется, он генерирует 539A708FA1B44490 в запросе SOAP для идентификатора корреляции.
но при этом Утверждение, что сценарий для CorrelationId оценивается снова, что создает другой идентификатор.
Я просто хочу получить идентификатор coorelation в полезной нагрузке, отправленной в запросе, чтобы я мог сравнить.
Я просмотрел документы и искал решение, но не нашел.
Заранее благодарен за помощь.