【发布时间】:2021-07-26 08:29:34
【问题描述】:
我的问题与另一个现有问题相似(对此感到抱歉),但有所不同...我的 XML 输入具有字符串格式:
* def token = '123456'
* def payload =
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.com">
<soapenv:Header/>
<soapenv:Body>
<ws:isValid>
<token>#(token)</token>
</ws:isValid>
</soapenv:Body>
</soapenv:Envelope>
"""
* print payload
哪些打印:
[print] <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.com">
<soapenv:Header/>
<soapenv:Body>
<ws:isValid>
<token>#(token)</token>
</ws:isValid>
</soapenv:Body>
</soapenv:Envelope>
你能帮帮我吗?
我尝试了给定的解决方案,但也不起作用:
def num = '<num>' + random_num(5) + '</num>'
[print] <num>39631</num>
Given request:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1>
<ns1:XML_INPUT>
<testone>00</testone>
<numtwo>267</testtwo>
#(num)
<testthree>267</testthree>
</ns1:XML_INPUT>
</ns1>
</soap:Body>
</soap:Envelope>
【问题讨论】:
-
欢迎来到 StackOverflow!如果您知道可能存在重复,那么添加链接而不只是提及事实会很有用。