Last active
December 25, 2017 12:51
-
-
Save RaghuChandrasekaran/af8db0aa6a1d53f401084978c220dd3b to your computer and use it in GitHub Desktop.
SOAP UI - Mocking request script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path = mockRequest.getPath() | |
log.info(mockRequest.getMethod()) | |
filePath ="D:/folder/response"-"+mockRequest.getMethod()+".xml" | |
log.info(filePath) | |
String fileContents = new File(filePath).getText('UTF-8') | |
def httpResponse = mockRequest.httpResponse | |
httpResponse.setContentType("application/xml;charset=utf-8") | |
httpResponse.writer << fileContents | |
httpResponse.status = 200 | |
log.info(httpResponse.status) | |
return httpResponse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment