Turn from:
http://www.outsystems.com/forums/discussion/15641/ tip-the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-rece/
Symptom
You application are making a call to another system performing an HTTP (S) request. This request can be a:
- Web Service Call (SOAP or REST)
- A request to a specific web-page
- Sending an email
- ...
The call is failing and a error occurs in the application. In the "Error Log you see" an entry similar to (below example are for a SOAP web-reference):
[1] The underlying connection was Closed:an unexpected error occurred on a receive.
At System.Web.Services.Protocols.WebClientProtocol.GetWebResponse (WebRequest request)
At System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse (WebRequest request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (String methodName, object[] parameters)
At ssCRMApp.WRefPeopleLookup.WRefPeopleLookup.SearchByName (String search)
[2] Unable to read data from the transport Connection:an existing connection is forcibly closed by the remote host.< /c3>
At System.Net.Sockets.NetworkStream.Read (byte[] buffer, Int32 offset, Int32 size)
At System.Net.PooledStream.Read (byte[] buffer, Int32 offset, Int32 size)
At System.Net.Connection.SyncRead (HttpWebRequest request, Boolean Userretrievedstream, Boolean proberead)
[3] An existing connection is forcibly closed by the remote host
At System.Net.Sockets.NetworkStream.Read (byte[] buffer, Int32 offset, Int32 size)
Cause
Errors like these happen because the remote server (to which the call is being made) did not deliver a response to your R Equest and cut the connection before an answer could is sent. Meaning:
- Your application (the caller) sent the request
- While the application is waiting for the response, the remote server cut the connection.
Resolution
Resolving such a problem cannot be do on the caller side (your application)-your need to work with the party that Provi Des the service for you.
If You is the other party or want to help:common causes on the other side for these errors is:
- The request is taking too long-to-run and the server "times it Out". If another Outsystems Platform is on the receiving end (Meaning:the Web call was to a outsystems Platform) you may want t o look here.
- The remote server is having a issues. e.g. application pool recycling or crashes that interrupt logic so may be runnning.
- A Network layer is cutting the network connection Half-way. Errors in the remote server similar to this one (e.g. "could not flush response);
The underlying connection was Closed:an unexpected error occurred on a receive