我想使用SoapUI来实现一个模拟webService的功能,其中用到根据Request报文的内容,填写Response报文的内容。其他地方都搞定了,但是脚本该怎么写一直搞不定。请诸位帮忙看一下。
首先,我的项目目录很简单,如下
其中只有一个Response报文,内容如下:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:axis="http://axis2.iis.xxxx.com">
<soapenv:Header/>
<soapenv:Body>
<axis:RequestMessageResponse>
<!--Optional:-->
<axis:return>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<header>
<msgType>A</msgType>
<clientID>${CLIENTID}</clientID>
<sendDateTime>${SENDTIME}</sendDateTime>
<IP>${IP}</IP>
<errorCode>0</errorCode>
</header>
<body>
<status>OK</status>
<errInfo></errInfo>
</body>
</root>
]]>
</axis:return>
</axis:RequestMessageResponse>
</soapenv:Body>
</soapenv:Envelope>
其中红色部分是我的业务报文。
如果应答报文中的“CLIENTID”值取请求报文中的“CLIENTID”值,“SENDTIME”值取当前时间戳,“IP”值取请求报文中的“IP”值,那么请问脚本该怎么写呢?