Forum Discussion

mscheuner's avatar
mscheuner
Visitor
10 years ago

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.

  • nmrao's avatar
    nmrao
    Champion Level 3
    Never tried, but you may to try groovy to send the mock response, so there you must be able to log the received request.
  • atulb's avatar
    atulb
    New Contributor

    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())