Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > System.Net.WebException when calling a webservice

Reply
Thread Tools

System.Net.WebException when calling a webservice

 
 
atip
Guest
Posts: n/a
 
      06-10-2004
I am calling a web service that takes a long time to process.
In Windows 2003 Server I get a System.Net.WebException error
The underlying connection was closed: An unexpected error occurred on a receive

If I turn off the keep alive check box in the web site properties, it runs with no problems.
I have tried to set the KeepAlive to False and the protocol to HTTP 1.0 for the WebRequest, leaving the general site KeepAlive option active, but with no success.

Thanks for any help, workarounds or suggestions for other implementations.
 
Reply With Quote
 
 
 
 
[MSFT]
Guest
Posts: n/a
 
      06-11-2004
Hello,

A web service excuting has some timeout settings as follows:

1.<httpRuntime executionTimeout = "???"> in Machine.Config This one is
concerned with the ASP.NET web application's runtime timeout property, and
in dotnet, the machine config always provide a default setting for all the
application. So you can override them in the applicaiont's config file. For
example as the ASP.NET web application or web service, you can override it
by modifying the "httpRuntime" element's "Timeout" attribute .

2. <sessionState timeout = "???"> in Web.ConfigThis "timeout" is set for
the asp.net web application's session state, not
the limit for the serverside's executing time

3. <httpRuntime executionTimeout = "???"> in Web.Config The same as in the
machine.config but can override the value in
machine.config

4. responseDeadLockInterval attribute of the <processModel> tag

You may change this value to see if it will help.

Additionally, on client side, the web service proxy client also has a time
out property. The default proxy timeout value for the client is 100
seconds. You can modify the proxy timeout value by using the timeout
property of the proxy as follows:

webserver.Service1 ws = new webserver.Service1();
ws.Timeout = System.Threading.Timeout.Infinite;

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
 
 
 
atip
Guest
Posts: n/a
 
      06-11-2004
Hi Luke,

I have set all the settings way high and I'm still getting the error.
Enabling the processModel and setting the responseDeadlockInterval, gives me an error in the async call to the web service.

BTW the ws works fine on Windows 2000, and it also works if I set the KeepAlive Timeout for the site to a higher value in Windows 2003 server. If instead of doing this, I uncheck the keepalive option for the site, the app raises the exception too (this was an error in my initial post, sorry!).

I am using VS.NET 2003, .NET FWK 1.1, and Windows 2003 Server.

Thanks,

Antonio Iglesias.


 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      06-14-2004
Hi Antonio,

So, is it a work around to set the Keep-Alives and Connection timeout to a
large number? If you just want to set Keep-Alives to False, you may try the
suggestion in this link:

http://weblogs.asp.net/jan/archive/2.../28/63771.aspx

Luke

 
Reply With Quote
 
atip
Guest
Posts: n/a
 
      06-14-2004
Hi Luke,

Yes, setting the timeout high is a workaround.

I had already tried this. I found it surfing the net prior to posting the question, but
it did no solve my problem. Actually, when I set the KeepAlive=False on site's configuration I keep getting the error. It only works when I set the timeout high and KeepAlive=True.

Do you have any other idea?

Regards,

Antonio.


 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      06-15-2004
Hi Antonio,

Or you may try Asynchronous Web Service:

Creating Asynchronous XML Web Service Methods

http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconCreatingAsynchronousXMLWebServiceMethod.asp


Luke

 
Reply With Quote
 
atip
Guest
Posts: n/a
 
      06-15-2004
Hi Luke,

I was already calling the web service with an asynchronous call, since it takes so long to complete.

Do you believe that if I do a synchronous call the behaviour of IIS may be different?

Regards,

Antonio.
 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      06-16-2004
Hi Antonio,

I don't think synchronous call will help on this issue. It look to me that
we can only set keep-alives to true for the issue.

Luke

 
Reply With Quote
 
Yan-Hong Huang[MSFT]
Guest
Posts: n/a
 
      06-18-2004
Hi Antonio,

I think the main concern here is that the method in the web service takes too long time. So there is no way for any client to improve the response
time. Synchronous and ASynchrionous won't help to improve the response time under this situation.

Thanks.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
atip
Guest
Posts: n/a
 
      06-18-2004
Hi,

The web service is a heavy financial calculation. If I split the single call into several small calls the overall time will be increased tremendously and the system will have to control session state between calls. The calculation is being perform today in a Excel spreadsheet, and the objective is running the same calculation in a multithreaded app running on a server. Performance is the main objective. Compiling and splitting the calculation on several threads has done the trick (the calc time has gone down to 1/10 of the time with the same hardware).

I am happy with the time it takes to compute now. My concern is that the connection breaks while performing the calculation, thus not being able to return the results to the client. This calculation may take from 1' to 20' in the worst case.

I feel setting the keep alive timeout to a higher value for the whole site may impact other applications that may run on the server. That's why I do not like that workaround.

I know that sync vs async won't help making the call faster, it only helps with responsiveness of the UI. What I was asking was whether or not making a synchronous call would help keeping the connection alive. I believe not, but that was my question for Luke.

Thanks for your reply.

Antonio.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista ASP .Net 1 01-26-2006 12:05 PM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista ASP .Net Web Services 0 01-26-2006 08:14 AM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista ASP .Net 0 01-26-2006 08:13 AM
Calling a webservice from a webservice bgauvey@gmail.com ASP .Net Web Services 2 04-20-2005 02:02 PM
Webservice calling a webservice.....Error Peter Nordström ASP .Net Web Services 0 10-21-2003 12:02 PM



Advertisments