Contributions
Re: Mock Service: mockRequest.requestContent is NULL (HTTP PUT)
Hi i found one workaround for the problem. We are getting null output formockRequest.getRequestContent() for PUT request The workaround would be to use the following code InputStream is = mockRequest.request.inputStream BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8")); StringBuilder sb = new StringBuilder() while((s=br.readLine())!=null) { sb.append(s) } String payLoad = sb.toString() log.info payLoad7 years agoPlace ReadyAPI QuestionsReadyAPI Questions9.2KViews3likes4CommentsRe: Re: Unable to access content of REST MockService mockRequest
As per the blog it is bug. So we can stop discussing on this topic https://community.smartbear.com/t5/SoapUI-Pro/Mock-Service-mockRequest-requestContent-is-NULL-HTTP-PUT/td-p/421387 years agoPlace ReadyAPI QuestionsReadyAPI Questions4KViews0likes2CommentsRe: Re: Unable to access content of REST MockService mockRequest
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"7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.1KViews0likes3CommentsRe: Re: Unable to access content of REST MockService mockRequest
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.7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.1KViews0likes5CommentsRe: 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..7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.4KViews0likes10Comments