Skip to content

Instantly share code, notes, and snippets.

@RaghuChandrasekaran
Last active December 25, 2017 12:51
Show Gist options
  • Save RaghuChandrasekaran/af8db0aa6a1d53f401084978c220dd3b to your computer and use it in GitHub Desktop.
Save RaghuChandrasekaran/af8db0aa6a1d53f401084978c220dd3b to your computer and use it in GitHub Desktop.
SOAP UI - Mocking request script
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