如何使用groovy从以下请求中获取用户ID的*******:
green
答案 0 :(得分:0)
参考doc。无论如何,对于你的问题,它将是快速回答,
试试这段代码:
String txt = '''<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rol="http://www.visa.com/ROLSI">
<soapenv:Header/>
<soapenv:Body>
<rol:SIGetBatchQueueRequest>
<rol:RequestHeader>
<rol:User id="******" type="internalId"/>
<rol:MemberRole>A</rol:MemberRole>
</rol:RequestHeader>
<rol:RequestData>
<rol:BatchQueueType>AWAITING_ACTION_BQ_PRE_FILING</rol:BatchQueueType>
<!--Optional:-->
<rol:PageNum>?</rol:PageNum>
</rol:RequestData>
</rol:SIGetBatchQueueRequest>
</soapenv:Body>
</soapenv:Envelope>
'''
println new XmlParser().parseText(txt).'soapenv:Body'.'rol:SIGetBatchQueueRequest'.'rol:RequestHeader'.'rol:User'.'@id'