restpostmockingsoapui

SoapUI 5.7.0 mockRequest.requestContent is empty for POST request


I am using SOAP UI 5.7.0 to mock a REST service and it is working fine. Only, when I want to access the body of a POST request with mockRequest.requestContent, the correct content is returned only in the first call, but from then on, it always returns the empty string.

I tried the call in OnRequestScript and in the POST requests own Dispatch script but the behavior is the same in both cases. I have the suspicion, that the Stream of the request is already read somewhere else and so does not return any more content. But I don't know what to do about it.

I wonder what is the correct way to read the content of a POST request.

Thank you

enter image description here


Solution

  • Appears to be a known issue, see posts in the community forum here and here.

    this seems to be an old bug of PUT operation in REST mocks.

    Unfortunately, this is a bug. There is an internal defect of SOAP-2344 for this issue. This applies for the PUT and DELETE methods for a REST mock service.

    I have the same issue with a PATCH request.