Hello.
I'm getting probably the same issue in POST requests. I'm trying to read JSON request body in the dispatch script of my RESTfull mock in SOAPui.
// log the request body
log.info(mockRequest.getRequestContent())
// Parse the JSON request.
def requestBody = new groovy.json.JsonSlurper().parseText(mockRequest.getRequestContent())
// Set up MSISDN value from the request message.
requestContext.msisdn = requestBody.phone_number
requestContext.uuid = requestBody.MC_UUID
return "Response_OK"
After mock restart it works just once. When I repeat the request with same (or different) values it stops on Null value in getRequestContent.
I'm using SOAP UI 5.5.0 for mock and Postman 7.16 for client.
Sending the request
POST http://localhost:8181/v1/identity
{
"MC_UUID":"550e8400-e29b-41d4-a716-446655440000",
"phone_number":"31657100013"
}
with headers
Content-Type:application/json
Accept:application/json
User-Agent:PostmanRuntime/7.16.3
Content-Length:89
Connection:keep-alive
Host:localhost:8181
Cache-Control:no-cache
Accept-Encoding:gzip, deflate
In the script log of the SOAP ui mock I can see
Mon Sep 09 18:14:40 CEST 2019:INFO:{"MC_UUID":"550e8400-e29b-41d4-a716-446655440000","phone_number":"31657100013"}
Mon Sep 09 18:14:46 CEST 2019:INFO:
So 1st time the request passed with correct body, 2nd time the same POST is delivered with empty body.
I need always to restart the mock to make the 1st test working.
Very strange behaviour.
Thanks in advance for any hints & advices.
Jozef