2

I have a webservice written in Web API ,it uses some very large tables .

When I run it locally, through the code, it's Fine .But when I publish,and put it to the webserver , it (SOMETIMES) returns Error, most of the times, Timeout Error .

I set Timeout in web.Config with this line

  <httpRuntime targetFramework="4.5" executionTimeout="1000" />

But before ending this time, Error happens.

I caught TimeoutError error using

 catch (TimeoutException e)
  {
     return Request.CreateErrorResponse(HttpStatusCode.NotFound, "Timeout Error." + e.Message);
  }

But the error it gets is general ,

{ "Message": "An error has occurred." }

Its very likely to be timeout error, because when I test it with much less records , it works fine.

I'm new in Web API , also creating webservice . So What's my mistake in this?

Sara N
  • 1,079
  • 5
  • 17
  • 45
  • Apply "Index" to your condition columns in your database.You can retrieve the data fast. – Kakumanu siva krishna May 05 '16 at 12:15
  • @Kakumanusivakrishna tnx for ure comment. but I think my problem is something byond database tunning, I've applied all required indexes , table partitionings , ... to DB. it works fine in my IIS (when I run from local system) , but it return timeout when it comes to webserver IIS7 – Sara N May 06 '16 at 00:10

0 Answers0