Hello: I created a win form application which attempts to consume a web service on a remote machine. I receive the following message when trying to invoke the web service: "An unhandled exception of type 'System.Net.WebException' occurred in system.web.services.dll
Additional information: The underlying connection was closed: An unexpected error occurred on a receive. ************** Exception Text ************** System.Net.WebException: 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 CMS2003SystemTray.CMSWebService.CMS2003WS.QueryReminder(String userid) in C:\Inetpub\wwwroot\CMS2003SystemTray\Web References\CMSWebService\Reference.vb:line 155 at CMS2003SystemTray.LoginForm.CheckReminders() in C:\Inetpub\wwwroot\CMS2003SystemTray\LoginForm.vb:line
504 at CMS2003SystemTray.LoginForm.Timer1_Tick(Object sender, EventArgs e) in C:\Inetpub\wwwroot\CMS2003SystemTray\LoginForm.vb:line 369 at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr
idEvent, IntPtr dwTime)" I search the web for some answers, but I couldn't find any solutions. Do you have any ideas? Thanks, WILL
Some questions: Does this happen consistently? Are you calling from multiple threads? Does the WebService take long time processing? Are you using SSL?
1: this happen occasionally 2: I don't use multiple threads 3: My application calls web service frequently(every 5 minutes), but I don't think the web service will take long time to process the request. 4: I have no SSL Please help me again!
Are you using a WebRequest method? If so, be sure the site you are trying to access is accessible all the time. Also, set a WebException error to capture the error. Use a Try..Catch to catch and display this error. You might also want to use tracing to trace
the app calls.
Jason N. Gaylord
ASPInsider and Microsoft MVP
http://jasongaylord.com
Yes, I use it. Now I add "try... catch" into my code see what is the exact error message. if the problem still there, I need the help again! anyway, thanks a lot!
I too am recieving this error. this works fine on a local host but when i transfer it to our server i get this error. I know it has to deal with authentication to view the webservices. MEaning before calling every webservice I am declaring a credentials Dim
credentials As System.Net.NetworkCredential = New System.Net.NetworkCredential("IEasp_USeR", "password") Service.Credentials = credentials i hope someone can help us out with this....
I too receive this error. I am building a web application to access a remote SMS service. My application always throws this exception (see below). From TCP level traces I've done it seems that, although a connection is successfully established and the client
sends a valid SOAP message, the connection is broken and the server never responds. I've confirmed, though, that there's is no issues with it, since the same messages were delivered OK from a VB.NET windows application that hard-codes the message and sends
it over to the server. There is both client and server authentication performed, and the procedure of loading the certificates is the same on both applications. Since I changed location last week, both my web application and my windows application fail with
the same exception. It seems that people usually get this error due to a proxy misconfiguration, this is not my case though, since I'm not using a proxy. Any ideas much appreciated! The underlying connection was closed: An unexpected error occurred on a receive.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The underlying
connection was closed: An unexpected error occurred on a receive. Source Error: Line 68: _Line 69: Public Function sendsimplemessage(ByVal Request As simplemessageRequest, ByRef ErrorMessage As String, ByRef Failed_MSISDN() As Object, ByRef RequestID As Integer)
As IntegerLine 70: Dim results() As Object = Me.Invoke ("sendsimplemessage", New Object() {Request})Line 71: ErrorMessage = CType(results(1), String)Line 72: Failed_MSISDN = CType(results(2), Object()) Source File: c:\inetpub\wwwroot\WebApplication1\Web References\BrokerService\Reference.vb
Line: 70 Stack Trace: [WebException: The underlying connection was closed: An unexpected error occurred on a receive.] System.Web.Services.Protocols.WebClientProtocol.GetWebResponse (WebRequest request) +58 System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse
(WebRequest request) +5 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +183 WebApplication1.BrokerService.BrokerService.sendsimplemessage (simplemessageRequest Request, String& ErrorMessage, Object[]& Failed_MSISDN,
Int32& RequestID) in c:\inetpub\wwwroot\WebApplication1\Web References\BrokerService\Reference.vb:70 WebApplication1.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm1.aspx.vb:70 System.Web.UI.WebControls.Button.OnClick(EventArgs
e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler. RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData) +33 System.Web.UI.Page.ProcessRequestMain() +1277
Hi, I am currently experiencing the same problem. Everything works fine in my debug environment. Once I create a Service and install it I get a web.exception saying the connection was closed. I imported all the certificates to maschine, user and service. When
I attach the degger to the process I excierence no calls to myCertificateValidation Class. We are going on a production environment soon and I will appreciate any help I can get. Karl 'Here is my code ServicePointManager.CertificatePolicy = New MyCertificateValidation()
_web = WebRequest.Create(_URL) With _web .Method = "POST" .Headers.Set("Pragma", "no-cache") .Timeout = _timeOut .Credentials = New NetworkCredential(Me._userID, Me._password) .ContentType = "application/x-www-form-urlencoded" End With
happyface
Member
20 Points
4 Posts
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a ...
Nov 21, 2002 06:05 PM|LINK
xwscom3
Member
5 Points
1 Post
Re: System.Net.WebException: The underlying connection was closed: An unexpected error occurred o...
Nov 23, 2002 01:55 AM|LINK
happyface
Member
20 Points
4 Posts
Re: System.Net.WebException: The underlying connection was closed: An unexpected error occurred o...
Nov 25, 2002 01:44 PM|LINK
j_gaylord
Contributor
3444 Points
731 Posts
ASPInsiders
MVP
Re: System.Net.WebException: The underlying connection was closed: An unexpected error occurred o...
Nov 25, 2002 06:10 PM|LINK
ASPInsider and Microsoft MVP
http://jasongaylord.com
happyface
Member
20 Points
4 Posts
Re: System.Net.WebException: The underlying connection was closed: An unexpected error occurred o...
Nov 25, 2002 07:24 PM|LINK
happyface
Member
20 Points
4 Posts
Re: System.Net.WebException: The underlying connection was closed: An unexpected error occurred o...
Nov 26, 2002 01:18 PM|LINK
slightlystqq...
Member
5 Points
1 Post
Re: System.Net.WebException: The underlying connection was closed: An unexpected error occurred o...
Dec 03, 2002 02:52 PM|LINK
eleni
Member
5 Points
1 Post
Re: System.Net.WebException: The underlying connection was closed: An unexpected error occurred o...
Nov 03, 2003 11:06 AM|LINK
khaak
Member
10 Points
2 Posts
Re: System.Net.WebException: The underlying connection was closed: An unexpected error occurred o...
Dec 04, 2003 10:48 AM|LINK