Forum Discussion
I'm having the same problem with SoapUI 5.0.0 (Free) and REST mockservice scripting.
1. This script returns null for the requestContent:
def requestContent = mockRequest.getRequestContent()
log.info "message content: " + requestContent
--> Mon Mar 30 11:50:27 EEST 2015:INFO:message content: null
2. This next scripts return the message content in the first time to the script log fine, but in the second time it returns false, as said in the previous comments. I need to restart the REST mockservice, then it works in the first again, but then again in second time it returns false, so something seems to be wrong with the scripts on SoapUI 5.0.0?
try {
log.info mockRequest.getRequest().getReader().ready()
while ((line = mockRequest.getRequest().getReader().readLine()) != null)
log.info("line:" + line);
} catch (Exception e) {
log.error("exception:" + e)
}
-->
Mon Mar 30 11:53:01 EEST 2015:INFO:true
Mon Mar 30 11:53:01 EEST 2015:INFO:line:<?xml version="1.0" encoding="UTF-8"?>
Mon Mar 30 11:53:01 EEST 2015:INFO:line:<msg:deliveryInfoNotification xmlns:msg="urn:oma:xml:rest:netapi:messaging:1">
Mon Mar 30 11:53:01 EEST 2015:INFO:line:<deliveryInfo>
In second request it is not working anymore:
--> Mon Mar 30 11:49:41 EEST 2015:INFO:false
In error log I can see there error logs:
Mon Mar 30 11:43:51 EEST 2015:ERROR:java.lang.IllegalStateException: READER
java.lang.IllegalStateException: READER
at org.mortbay.jetty.Request.getInputStream(Request.java:718)
at com.eviware.soapui.monitor.JettyMockEngine$MockRequestLog.log(JettyMockEngine.java:797)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:51)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Related Content
- 12 years ago
- 10 years ago
Recent Discussions
- 15 years ago