Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 394829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:23:39+00:00 2026-05-12T16:23:39+00:00

In a C# ASP .NET application I have a web service that receives a

  • 0

In a C# ASP .NET application I have a web service that receives a DataSet, processes it, and returns it.

Returning it can take up to a minute over a slow connection. What happens in the background if that connection breaks after the last line of the web service method has run but while the data is still being sent?

I tried wrapping my web service’s code in a catch block and disconnecting the connection while it was downloading, but no exception was thrown in the web service. I’d to detect the error somehow like this:

[WebMethod(Description = "Process data")]
public DataSet Process(DataSet data)
{
   bool success = true;
   StartDatabaseTransaction();
   DataSet result = Process(data);
   try
   {
      return result; //quickly pull out cable after running this
   }
   catch
   {
      success = false;  //never gets here
   }
   finally 
   {
      if (success) CommitTransaction(); else RollBackTransaction();
   }
   return null;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:23:39+00:00Added an answer on May 12, 2026 at 4:23 pm

    If I read your question and code correctly, you will never hit the catch because of the way webmethods work. If you are looking to trap a timeout error it needs to be in the receiving method of the dataset. At the point of the return, it is the webserver that is working to transform and transmit the data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.net web service that I'm using for a web application which
I have an asp.net MVC2 application that needs to call a web service from
I have a ASP.NET web service ( .asmx ) with methods that receives int
I have an ASP.NET application that calls other web services through SSL (outside the
I am trying to call a web service from asp.net 3.5 application. I have
I have an ASP.NET application which talks to a third-party SOAP web service. My
In my asp.net application I have web service ~/service.asmx and generic handler ~/handler.ashx .
We have an ASMX web service which we invoke from our ASP.NET application using
Sometime ago for my asp.net application I have added a web service. After some
I have a Silverlight app that consumes a WCF service in my asp.net application.The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.