Clawzix
4 years agoOccasional Contributor
How to get a file which is in a tag?
Hello,
Sorry, I don't speak english really well...
I made a request based on a wsdl, i was searching for a .zip file and I got it in a tag.
Please can you tell me how to make this file in a directory in my computer?
Thank you in advance!
Kind regards Clawzix.
nmraoI know that you are helpfull for SoapUI users please help me if you can.. I need an answer as quick as possible..
This is based the image you provided.
Script is based on assumptions. you need to test it.
Add the below script as Script Assertion for the SOAP Request test step
assert context.response def zipContent = new XmlSlurper().parseText(context.response).'**'.find{it.name() == 'MessageZip'}.text() def zipFile = new FileOutputStream(new File(System.getProperty('java.io.tmpdir')+'/test.zip')) def inStream = new ByteArrayInputStream( zipContent.getBytes( 'UTF-8' ) ) if (inStream) { com.eviware.soapui.support.Tools.writeAll(zipFile, inStream) } inStream.close() zipFile.close()