I have a requirement where I need to send everytime the same PDF as a response. It is a REST service, Could some one help me, Where can I attach the file and continue the testing in serviceV Pro.
Note: I am not talking about SOAPUI or SOAPUI Pro.
Please check if the replies given in this topic help you:
All the info in there are related to SOAP service, but I am working on REST Service and I do not find a way to attach the PDF file and test it. It's been more than 2 weeks i am stuck with this issue.
Why is that, there is no attachment properties for a REST service, it would have been more easy.
can you help me with the code or is there any other simpler way to attach a file. The below code did not work.
// get the path to the folder where your project resides. def projectPath = new File(context.mockService.project.path).parent // Specify the file path that is relative to the project’s path. def fileName = projectPath + "\\response\\abcd.pdf" log.info "CABIS-MOCK send response with file: " + fileName import java.io.FileInputStream import java.io.File File f = new File(fileName) FileInputStream fis = new FileInputStream(f) byte b = new byte[f.length()] requestContext.mockResponse.responseContent = f.text
Senthil kumar. M
I think it's worth redirecting this question to our ReadyAPI Support Team - perhaps, some investigation along with the R&D team will be required. You can contact them here: