在SoapUI Mock servcice中将返回数组作为响应

时间:2017-07-17 10:20:17

标签: groovy mocking soapui

我必须模拟一个soap webservice操作,它将字符串数组作为输出返回。我只能从下面的脚本生成一个字符串作为输出。 欢迎任何帮助。

//script
import groovy.xml.MarkupBuilder

// An array from which county and city will be drawn randomly

    def countryArray = 
    ["ONE",
    "TWO",
    "THREE"
     ]

    context.countryArray=countryArray

- 响应定义

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:upm="http://xxxx">
   <soapenv:Header/>
   <soapenv:Body>
      <upm:signResponse>
         <upm:signReturn>${countryArray}</upm:signReturn>
      </upm:signResponse>
   </soapenv:Body>
</soapenv:Envelope>

0 个答案:

没有答案