Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 4th, 2008, 12:42 PM
Registered User
 
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
The underlying connection was closed: jhouse .NET Web Services 33 September 21st, 2011 04:26 PM
The underlying connection was closed: An unexpecte adabass .NET Framework 1.x 0 October 12th, 2007 08:56 PM
The underlying connection was closed: unable to co badyalsk .NET Web Services 0 January 23rd, 2007 04:42 AM
Underlying connection was closed r_ganesh76 .NET Web Services 0 May 4th, 2006 04:49 AM
The underlying connection was closed: Unable to co anurag_singh02 .NET Web Services 1 August 17th, 2005 11:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.