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?