cancel
Showing results for 
Search instead for 
Did you mean: 

Log entire REST request in a mock rest service

mscheuner
Visitor

Log entire REST request in a mock rest service

I'd like to be able to log the entire REST (JSON) requests that come into a Mock REST service in SoapUI. I do see them in the Message Log - but only the date/time stamp and the URL is shown - no details (like the actual *JSON contents* of the request) is visible and accessible.

 

That would be a great addition to verify that the incoming requests are indeed formatted as I need them to be.

2 REPLIES 2
nmrao
Community Hero

Re: Log entire REST request in a mock rest service

Never tried, but you may to try groovy to send the mock response, so there you must be able to log the received request.


Regards,
Rao.
atulb
New Contributor

Re: Log entire REST request in a mock rest service

It's possible to log request by using "OnRequest Script" option in Mock Service Editor (I am using version 5.2.1)

 

Put following code in above option and the request content should be visible in "Script Log"

 

log.info(mockRequest.getRequestContent())
New Here?
Join us and watch the welcome video:
Top Kudoed Authors