Forum Discussion

SoapEater's avatar
SoapEater
New Contributor
13 years ago

Socket Timeout when testing Mock Server

Hey guys,

I've written a mock for a web service and tried to test it by sending a request via soapUI.

The mock consists of a bunch of java classes. It's only task is to receive an incoming request
of a client (which is soapUI during the tests), parse the request, choose a soap response template
depending on the content of the request and send that response back to the client.

By now, the mock server is able to read incoming requests and parse them for information.
However, when I try to send the response back to soapUI via java socket, I get the following
message in the statusbar of soapUI:

Error getting response; java.net.SocketTimeoutException: Read timed out.

If I raise the timeout value in the soapUI environment, the error will just appear a bit later.
I cannot image what I'm doing wrong. Any ideas?

Thank you in advance for any hints you can give me.
soapEater
  • SoapEater's avatar
    SoapEater
    New Contributor
    I developed a little test client which sends a request.xml and waits for the response.xml, just as I expect soapUI to do.
    There is no problem at all. The communication runs fast and smooth. I (speaking as the client) get my response.xml
    immediately after sending the response. After that the socket is closed and I'm able to send the next request.
    So, there must be some error in my soapUI configuration.

    What I observed as well:
    If I configure the timeout in the GUI of soapUI to be 5000 (ms), instead of 50, I expected soapUI to wait 5 seconds
    AFTER sending the request, before shutting down the socket. However, it seems that it waits 5 seconds BEFORE
    sending the request to the server. I noticed that because my server got the request messages 5 seconds later.
    This is utterly strange behavior, isn't it?
  • SoapEater's avatar
    SoapEater
    New Contributor
    SoapUI log:
    ERROR:Exception in request: java.net.SocketTimeoutException: Read timed out
    ERROR:An error occured [Read timed out], see error log for details

    INFO:Error getting response for [SECRET]; java.net.SocketTimeoutException: Read timed out

    Error log:
    Wed Jul 04 09:07:41 CEST 2012:ERROR:java.net.SocketTimeoutException: Read timed out
    java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:149)
    at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:110)
    at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:264)
    at org.apache.http.impl.conn.LoggingSessionInputBuffer.readLine(LoggingSessionInputBuffer.java:115)
    at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:98)
    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
    at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
    at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247)
    at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doReceiveResponse(HttpClientSupport.java:133)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:218)
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:329)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:251)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)