The underlying connection was closed: An unexpecte
Hi,
I have a webservice and a console application consumes that webservice.(everything on my local machine)
The Webservice has one method which takes a custom data type as input and sends back a custom response.
When I access this webmethod from my console application , I get this following error:
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive.
stack trace:
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.HttpWebRequest.MakeMemoryStream(Stream stream)
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.WebClientProtocol.Ge tWebResponse(WebRequestrequest)
at System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebResponse(WebRequest request)
at Microsoft.Web.Services3.WebServicesClientProtocol. GetResponse(WebRequest request, IAsyncResult result)
at Microsoft.Web.Services3.WebServicesClientProtocol. GetWebResponse(WebReques
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String methodName, Object[] parameters)
Please help how to get rid of this exception.
Thanks!
SK
|