11 years ago
Trouble Logging Request Content
I'm new at using SoapUI and attempting to use it as part of some automation testing. I've set up a mock REST service, which simply responds with a 200 - OK for any request.
I've added the following Groovy script to try and capture the request content:
The first time I send a request to the endpoint, I get what I expected:
Thu Aug 28 13:51:10 EDT 2014:INFO:true
Thu Aug 28 13:51:10 EDT 2014:INFO:line:asdasd
However, any subsequent requests sent to the mock service results in the call to mockRequest.getRequest().getReader().ready() not returning true.
I've tried using mockRequest.getRequestContent() as an alternative way to read the request, but that just returns null.
Any ideas?
Thanks.
I've added the following Groovy script to try and capture the request content:
try {
log.info mockRequest.getRequest().getReader().ready()
while ((line = mockRequest.getRequest().getReader().readLine()) != null)
log.info("line:" + line);
} catch (Exception e) {
log.error("exception:" + e)
}
The first time I send a request to the endpoint, I get what I expected:
Thu Aug 28 13:51:10 EDT 2014:INFO:true
Thu Aug 28 13:51:10 EDT 2014:INFO:line:asdasd
However, any subsequent requests sent to the mock service results in the call to mockRequest.getRequest().getReader().ready() not returning true.
I've tried using mockRequest.getRequestContent() as an alternative way to read the request, but that just returns null.
Any ideas?
Thanks.