473,320 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Connection timeout in .net web application that uses a webservice

Hi,

I have a .net web application that calls a webservice method to index a list. It works fine for small list. But for very large list, the application is throwing a run time error after 15minutes because of connection timeout.
I have tried using httpRuntime executionTimeout property in web.config, but no use of it. The problem still exists.

Please help me to solve this issue.
Oct 17 '08 #1
4 5694
PRR
750 Expert 512MB
Hi,

I have a .net web application that calls a webservice method to index a list. It works fine for small list. But for very large list, the application is throwing a run time error after 15minutes because of connection timeout.
I have tried using httpRuntime executionTimeout property in web.config, but no use of it. The problem still exists.

Please help me to solve this issue.
To communicate with the web service use Asynchronous Programming approach... Webservice may take longtime to respond to your request .. and you dont want your code to be blockin... (freeze... wont respond to UI)..Check articles for asynchronous programming....
Oct 17 '08 #2
PRR
750 Expert 512MB
With the help of delegate you can call "BeginInvoke" on any function.. By calling BeginInvoke you make the call to your function asynchronous...

Expand|Select|Wrap|Line Numbers
  1. using System.Threading;
  2. using System.Runtime.Remoting.Messaging;
  3. class Program
  4.     {
  5.         public delegate String AsyDel();
  6.         public AsyDel delAsy;
  7.  
  8.         static void Main(string[] args)
  9.         {
  10.             Program p=new Program();
  11.  
  12.             p.delAsy=new AsyDel(p.Some);
  13.             //Define a delegate to call "ANY" function Asynchronous...
  14.             // Delegate should have same signature...
  15.  
  16.             p.delAsy.BeginInvoke(new AsyncCallback(p.After_Some),null);
  17.             // 
  18.  
  19.  
  20.  
  21.             Console.ReadLine();
  22.  
  23.  
  24.             Console.WriteLine("After ");
  25.  
  26.         }
  27.  
  28.         public  string  Some()
  29.         {            
  30.                 Console.WriteLine("Doin Something Asy");
  31.                 Thread.Sleep(1000);
  32.                 return "C#";
  33.  
  34.  
  35.         }
  36.  
  37.         public void After_Some(IAsyncResult res)
  38.         {
  39.             AsyncResult ar = (AsyncResult)res;
  40.             string ss="Def";
  41.  
  42.  
  43.  
  44.            delAsy = (AsyDel)ar.AsyncDelegate;
  45.  
  46.             try
  47.             {
  48.                 ss = delAsy.EndInvoke(res);
  49.             }
  50.  
  51.             catch (Exception ex)
  52.             {
  53.                 Console.WriteLine(ex.Message.ToString());
  54.             }
  55.  
  56.             Console.WriteLine(ss);
  57.  
  58.         }
  59.     }
  60.  
Here in the above prog... public string Some() is a function that returns string... Normally the call would be "linear"... that is the main thread callin the function and blocking until the function is finished...
However here we have done it Asynchronously.. As soon as the function has completed you get notified as "After_Some" is called...
Simply replace the call to function with call to web service...You get the picture.. Web service may/ maynot respond.. still your application wont hang.. or crash...
Oct 17 '08 #3
PRR
750 Expert 512MB
Hi,

I have a .net web application that calls a webservice method to index a list. It works fine for small list. But for very large list, the application is throwing a run time error after 15minutes because of connection timeout.
I have tried using httpRuntime executionTimeout property in web.config, but no use of it. The problem still exists.

Please help me to solve this issue.
If you wish to increase the timeout of your web service .. you could do this
serviceObject.Timeout = 100000; // in milli seconds...
// or you could use -1... thats i guess infinite...
httpRuntime executionTimeout property default is 90 secs... I guess changing that in addition to the timout property of web service object should set things right..
i guess 15 min a lil too long... what exactly is your web method does?
Oct 17 '08 #4
PRR
750 Expert 512MB
You should also take a look at this
Web service requests from ASP.NET applications
You should also increase the Web service minWorkerThreads and executionTimeout
Oct 17 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
0
by: AndyG | last post by:
I am calling a webservice from a web page. I was getting this error "The underlying connection was closed: An unexpected error occurred on a receive." When I run it in debug mode, it works fine. To...
3
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. ...
2
by: RyoSaeba | last post by:
Hello, I have a problem with the session state set to Sql Server (AspNet 1.1, Windows Server 2003 on an Application Center cluster, Sql Server 2000 on another server). Sometimes, when many user...
4
by: Fred Zuckerman | last post by:
I have a A2K database that includes some linked tables (these links are SQL views). Sometimes there are "issues" with the SQL server and the users receive a timeout error whenever they try to...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
2
by: =?Utf-8?B?RnJpZWRoZWxtRWljaGlu?= | last post by:
I am consuming continously my own web-services on a localhost client with a rate of perhaps 35 request/response-pairs a minute. I am using "invoke-id=1", so there is at the same time only one...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.