Re: Unable to access content of REST MockService mockRequest
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Unable to access content of REST MockService mockRequest
Hi,
Currently I am using SoapUI Pro 5.1.2, full licensed.
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
I still get null response when I do PUT operation on the server.
Please let me know what is the problem..
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you send the request?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, Mock is started and Request is sent from Postman
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be you take a look the sample rest project with mock service below, have a look at it to see if that helps.
https://github.com/nmrao/sample-soapui-projects/tree/master/rest_sample
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think question is misunderstood. The example which is attached in Github is very basic GET request, which works for me. But the problem is I need to read the PUT request content in my mock. PUT request from my SUT can send either pass or fail status in metadata parameter to my mock. So, in mock I am try to read the PUT request content on PUT action using
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
On sending PUT request from Postman, I am getting "null" output. So, I want to understand whether is there any wrong in my procedure.
Thanks in advance.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry did not get you.
Where are you getting null?
Is response in Postman null? or In the Mock service Script Dispatcher?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the Mock service Script Dispatcher I am getting null.
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
The output of above line is null, i.e. "Request body: null"
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As per the blog it is bug. So we can stop discussing on this topic
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is some help? really?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ahhh.. so is a bug.. = means, nobody will fix it.. as usual..
