I've written a web service under Visual Studio in C# that has some service methods.
All works quick and fine in the client APP under Windows.
But if i use one method named "GetCertInfos" in a loop the loop gets
after a random amount of "GetCertInfos" calls into a timeout Exception.
The web method :
[WebMethod]
public string[] GetCertInfos(long certID)
{
string[] result = { };
DataRow[] rowsFound = dataManager.MainDataSet.tbl_Certificates.Select(String.Format("CertID = {0}", certID));
if (rowsFound.Length > 0)
{
DataRow rw = (DataRow)rowsFound[0];
result = new string[]{ rw["CertID"].ToString(),
rw["CertNumber"].ToString(),
rw["Description"].ToString(),
rw["QuestionsCount"].ToString(),
rw["SingleChoiceAnswers"].ToString(),
rw["TimeIndex_Min"].ToString(),
rw["TestPassPercentage"].ToString() };
}
return result;
}
the client loop code :
foreach (long certID in certIDs)
{
UserCertInfo certInfoTest = new UserCertInfo();
certInfoTest.CertID = certID;
certInfoTest.CertInfos = serviceManagerClient.GetCertInfos(certID);
certInfoTest.UserOwned = ownedCerts.Contains(certID);
int index = ownedCerts.LastIndexOf(certID);
certInfoTest.PayedTests = 0;
if (index >= 0)
certInfoTest.PayedTests = payedTests[index];
result.Add(certInfoTest);
}
What I have tried:
Increasing operationtimeout in service inner channel,
Setting Execution timeout in App.config
<system.web>
<httpruntime executiontimeout="180">