Borigor
11 years agoNew Contributor
[SOAP UI MockService] data Map usage for generating dynamic
Hello, all!
Wonder if there possibility to use Map for passing generated values and following handling in XML template in SOAP UI Mock Service.
Also curious if there some conditional structure allowed in template.
E.g., I have small piece of code:
and in my.xml:
Now response returned has empty 'two' & 'three' tags
Maybe it is possible to use some Object structure for data handling. The final aim of desired approach is generation response xml consists from rather big and reach parts of xml in cycle.
Would be grateful for useful advices.
Wonder if there possibility to use Map for passing generated values and following handling in XML template in SOAP UI Mock Service.
Also curious if there some conditional structure allowed in template.
E.g., I have small piece of code:
import com.eviware.soapui.support.GroovyUtils
def myMap = new StringToObjectMap()
myMap.put('1','TRF')
myMap.put('2','BGO')
def isFour = true
myMap.put('3','MSQ')
def groovyUtils = new GroovyUtils(context)
def xmlParser = new XmlParser()
def responseContent = xmlParser.parse( groovyUtils.projectPath + "my.xml" )
and in my.xml:
<one>
<two>${myMap.'1'}</two>
<three>${myMap['2']}</three>
<if $isFour><four>${myMap['3']}</four></if>
</one>
Now response returned has empty 'two' & 'three' tags
Maybe it is possible to use some Object structure for data handling. The final aim of desired approach is generation response xml consists from rather big and reach parts of xml in cycle.
Would be grateful for useful advices.