473,498 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trapping a client timeout in a webservice method

1 New Member
I am trying to find out how to trap a client timeout within a webservice method call.

I have a particular webservice method which does several things. The first thing it does it create a unique reference and what I want to be able to do is return it to the client if the method timesout because it is stuck in a subsequent part of the call. A try {} catch {} on the server doesn't seem to be invoked when the client call times out. Is there some other way of trapping that or do I have to go down the route of separating the server parts into separate webmethods?

e.g. In summary:

Expand|Select|Wrap|Line Numbers
  1. CLIENT CODE
  2. try {
  3.   string response = ServerCall();
  4. } catch (Exception e) {
  5.   // This is part is invoked when the time out occurs
  6. }
  7.  
  8. ---
  9. SERVER CODE
  10. [WebMethod]
  11. public string ServerCall() {
  12.   string myID = String.Empty;
  13.  
  14.   try {
  15.     myID = Part1GenerateUniqueID();
  16.      System.Threading.Thread.Sleep(600000);
  17.      Part2DoMoreStuff();
  18.      return myID; 
  19.   } catch (Exception e) {
  20.     // This is never called when the webmethod times out
  21.       return myID;
  22.   }
Jun 13 '13 #1
0 1035

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

Similar topics

4
1592
by: Razzie | last post by:
Hey all, I have a SOAP envelope with which I try to communicate to a webservice. Everything is fine, but when I try to access a parameter of the webservice method, I get the Object reference not...
2
18761
by: Ganga | last post by:
Hi All, I was just wondering whether is it possible to return a Data Table from a WebService method. Since I need to send only one table at a time, I dont want to return the entire Dataset. ...
2
4703
by: Dan | last post by:
All, I have a Web Service that validates a piece of data. However, the database that the data comes from is mamouth. So, it may take a long time for the validation query to complete. ...
0
963
by: Clamps | last post by:
I have a have a webservice deployed onto a production server that only works when client is executed from a machine with VS.NET installed. When executing client from test machine (no VS.NET) &...
4
1069
by: archana | last post by:
Hi all, I am having web method which is inserting some heavy data into database. Everytime client call this method i am generating some unique transaction. Client know that transaction ID. ...
1
1259
by: Terry Olsen | last post by:
I have a web app that gathers live data from network pc's and then displays it to the client. It worked fine until I was asked to allow the user to select multiple pc's for display. Now, depending...
7
5595
by: christian13467 | last post by:
Hi, I'm using ASP.Net 2.0 with IIS 6.0 on windows server 2003 sp1. Calling a commandline program or a cmd file using Process.Start inside a webservice method. The call to Process.Start returns...
7
1556
by: Nick | last post by:
Hi there, Is it possible to tell how a WebMethod was invoked? For example I would like to determin if it was invoked via SOAP or HTTP Post. Other than creating 2 methods I am no sure if I can...
4
7127
by: Jonathan | last post by:
I have a SQL stored procedure for adding a new record in a transactions table. It also has two return values: CounterID and IDKey. I want to create a webservice that accepts the 10 input...
2
2085
by: lunet | last post by:
hello, this has been asked before but no answers yet.. I need help! how can write a webservice method with attribute ? like this xml : <soap:Envelope...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7203
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.