gpt4 book ai didi

soap - 将值从请求传输到响应(soapUI 模拟服务)

转载 作者:行者123 更新时间:2023-12-04 05:20:27 24 4
gpt4 key购买 nike

我收到了一个 15 位的用户 ID,想修剪它的最后 3 位,然后发回给请求发件人。请求样本如下:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<lookupSubscriberInfo xmlns="http://testID.com/V1_0">
<callingParty>testParty</callingParty>
<subscriberRequestList>
<testId>888905425616681</opaqueId>
</subscriberRequestList>
</lookupSubscriberInfo>
</env:Body>
</env:Envelope>

我读过这个
http://www.soapui.org/Service-Mocking/creating-dynamic-mockservices.html
但想不通..

最佳答案

我无法通过 XPATH 做到这一点,另一方面 XmlSlurper 已经工作了..

import groovy.util.XmlSlurper
def parsedContent = new XmlSlurper().parseText(mockRequest.requestContent)
context.MSISDN = parsedContent.Body.lookupSubscriberInfo.subscriberRequestList.opaqueId.toString().substring(3,15)

为了使用 MSISDN 值,您应该使用以下内容

${MSISDN}

关于soap - 将值从请求传输到响应(soapUI 模拟服务),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13738362/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com