Kevin_Mannering
17 years agoOccasional Contributor
Writing a new file from datasink for each iteration instead of appending
Hi,
I am a greenhorn soapui pro user, trying to save each response to a request in a separate file.I can append all the results in a single file, but I am running about 100 paramaterised requests and would like to save 100 datasink files.
This probably works somehow with groovy, but I have spent the afternoon trying to hack it without sucess and promise i have read all the docu.
Have this code so far, but I can't see how to write the response:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "Erstbereitstellung ISP0 --> Aufruf 1#Response" )
log.info( holder.getNodeValue( "//ns1:RequestId" ))
holder.setNodeValue( "//ns1:SubscriptionId", ""+Math.random() )
file = new File("D:captured-request.xml")
So how can I write the holder to a file??
Tnks, lugboy
I am a greenhorn soapui pro user, trying to save each response to a request in a separate file.I can append all the results in a single file, but I am running about 100 paramaterised requests and would like to save 100 datasink files.
This probably works somehow with groovy, but I have spent the afternoon trying to hack it without sucess and promise i have read all the docu.
Have this code so far, but I can't see how to write the response:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "Erstbereitstellung ISP0 --> Aufruf 1#Response" )
log.info( holder.getNodeValue( "//ns1:RequestId" ))
holder.setNodeValue( "//ns1:SubscriptionId", ""+Math.random() )
file = new File("D:captured-request.xml")
So how can I write the holder to a file??
Tnks, lugboy