Groovy 在SoapUI模拟服务中将数组作为响应返回

Groovy 在SoapUI模拟服务中将数组作为响应返回,groovy,mocking,soapui,Groovy,Mocking,Soapui,我必须模拟SOAPWebService操作,该操作将字符串数组作为输出返回。我只能从下面的脚本生成一个字符串作为输出。 欢迎任何帮助 //script import groovy.xml.MarkupBuilder // An array from which county and city will be drawn randomly def countryArray = ["ONE", "TWO", "THREE" ] context

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

//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>

${countryArray}

问题是什么?您打算如何在其中包含数组?Webservice响应是一个字符串数组,例如Strng[]methodA(){String[]response=new String[]{“一”、“二”、“三”};return response;}我需要模拟上述方法,所以我的mock方法需要输出一个字符串数组,要求输出一个数组作为mock的soapui服务方法的响应。