Hi,
I wrote a test WCF service that returns a string array as long as the parameter of the method.
public class XNS_Test : IXNS_Test {
public string[] testString(int num) {
string[] s = new string[num];
for(int i = 0; i < num; i++) {
s[i] = "abcde";
}
return s;
}}
I wrote a Form App to see how much time it takes:
private void button1_Click(object sender, EventArgs e) {
int num = Convert.ToInt32(textBox1.Text);
int[] intArr;
string[] stringArr;
TimeSpan start = DateTime.Now.TimeOfDay;
try {
XNS_Test.XNS_TestClient client = new testWCFServices.XNS_Test.XNS_TestClient();
if(((Button)sender).Name == "button2")
intArr = client.testInt(num);
else
stringArr = client.testString(num);
}
catch { }
TimeSpan stop = DateTime.Now.TimeOfDay;
label1.Text += num.ToString() + " elements: " + stop.Subtract(start).ToString() + "\n";
}
If I try to generate a string[x] where x<=2480 the service answer in less then 5 seconds, otherwise a timeout occurs (I set it to 1 minute).
Why a string[] of 2480 is returned in 4 seconds and a string[] of 2481 causes a timeout.
I think I have to change a config setting but I don't know which one.
I use wsHttpBinding with reliableSession and without security.
Thanks,
Alberto