Add a pdf as an attachment for a mock response
I am reading a file from my system and i need to send it as a pdf attachment in my mock response. I am using ready api. Can any body give me advice please? I have tried the below code and when the request is made, the pdf is downloaded but it fails to load it on the browser. String filename='C:/soapui.log' File file = new File(filename); def headers = mockResponse.responseHeaders headers["Content-Type"]=["application/pdf"] headers["Content-Disposition"]=["attachment.pdf"] mockResponse.responseHeaders=headers How do i return a file as a pdf,which i am reading in from my system Any suggestions please? Thank youSolved10KViews0likes8CommentsIn ServiceV, how do I return a scripted response without it being overwritten in the Editor?
Hello, In one of my Virts, I have a Response typed out in XML in the Editor. I am using the "Script" tab to make Gzip and Base64 the message, as this is what our service expects. The script looks like this: def targetStream = new ByteArrayOutputStream() def zipStream = new GZIPOutputStream(targetStream) def data = mockResponse.getResponseContent().toString() zipStream.write(data.getBytes()) zipStream.close() def zipped = targetStream.toByteArray() targetStream.close() mockResponse.setResponseContent(zipped.encodeBase64()) This code "works" because it sends back the message as I expect. However, it has the side effect of changing the content of the Editor from XML to the encoded/GZipped message. Is there a way to do this so that it does not overwrite what is in the Editor. i.e. It would be beneficial to be able to see the message in plaintext. Thanks in advance.2.2KViews1like2Commentshow to create a virtResponse Fault?
Hi, new user here. been playing with the soapui free version for months and finally got upgraded to the Ready!API 1.3.0 package with SoapUI NG Pro. i have to say...it's a lot different! in soapUI free version, there's a button with an exclaimation mark in it that allows me to change a normal mock response to a fault. any idea how i can create mock fault responses in SoapUI NG Pro? Thanks!!1.2KViews0likes1CommentSOAPUI 5.1.3- MockResponse Attachments content-type = text/csv
In my MockResponse I have to set content-type = text/csv. If I do this Content-transfer-encoding =quotable-printable. Now because of this in my SOAP client I get below error: Caused by: java.io.IOException: Found LF without CR at org.apache.james.mime4j.codec.QuotedPrintableInputStream.read0 Exception in thread "main" org.apache.axiom.om.OMException: org.apache.axiom.ext.io.StreamCopyException: Error reading from source at org.apache.axiom.attachments.PartContentFactory.createPartContent(PartContentFactory.java:153) How can I set content-transfer-encoding = binary? Will this solve it. See the response attachment that fails in my SOAP client1.3KViews0likes1Comment