对于一个 SOAP API 调用,我们得到如下所示的响应(发送虚拟响应)。
--uuid:123456
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Header>
<m:Trans xmlns:m="https://www.w3schools.com/transaction/"
soap:mustUnderstand="1">234
</m:Trans>
</soap:Header>
<success>true</success>
<correlationId>123456abcd</correlationId>
...
...
</soap:Envelope>
--uuid:123456--
我需要从 xml 响应中获取correlationId(123456abcd)值。
我尝试了以下方法。
替换值不起作用
尝试使用如此多的逻辑和正则表达式来实现此目的,但没有任何效果,您能帮助我们吗?
谢谢。
您应该能够在一行中获取该 id,如下所示:
* def id = //correlationId