1
votes

I wish to test and observe timeout behaviours between a WCF client and service host. For receiveTimeout and sendTimeout, it is probably easy to transmit a large byte stream that takes more than a few seconds and set those timeout attributes to ridiculously low values.

However, since there is nothing that can be done beyond the calling of a serviceProxy.Open() or .Close() methods, I am thinking what is a good way to delay the opening and closing of WCF connections, to cross the thresholds of openTimeout and closeTimeout?

1
Your questions is a subset of my question (stackoverflow.com/questions/982098/…). If you find the answer, please me let know. ThanksSylvain

1 Answers

0
votes

Well, if you have exposed your contracts correctly (as interfaces), you can mock an instance of the proxy which throws TimeoutException and pass it to your code for use.