How to get a file which is in a tag?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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..
Solved! Go to Solution.
- Labels:
-
SOAP
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean to save the attachment from the response?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
https://community.smartbear.com/t5/SoapUI-Open-Source/Save-attachments-automatically-in-SoapUI-with-...
Other shows details please for better understanding.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is my file, how to get it?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry but my file is not an attachement, it is not in the attachement tab..
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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()
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, i did what you told me to do but the when I submit the test the assertion fail and there is no test.zip file in my temp directory.
Regards,
Clawzix
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change from
assert context.assert
to
assert context.response
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok thanks a lot now I have the zip file, but when I try to unzip it, my computer tell me that the file is damaged and that my file is not an archive and I cannot get my xml file in it
May be I should do something else than to unzip it?
Regards,
Clawzix.
