[SoapUI 5.2.1] mockRequest is NULL in REST MockService
I'm using SoapUI 5.2.1 and I have a REST MockService. Whenever I try to implement the following script, I get the NullPointerException .
Script:
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
Error:
com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; java.lang.NullPointerException: Cannot invoke method getRequestContent() on null object
This is a very frustating error that I'm continuously getting, and surprisingly there is no helpful solution anywhere. Please Help!!!!
PS : I'm trying to get the content of a HTTP GET request.
Hi,
Like Rao said, we need a few more details, the functionality should definitely work. Here is my mock setup for reference:
The output you can see in the (script) log is the result of me making a GET request of: http://localhost:9090/test?p=hello
Regards,
Rup