New Posts New Posts RSS Feed: Custom ServiceProxyEvents for setting Timeout
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Custom ServiceProxyEvents for setting Timeout

 Post Reply Post Reply
Author
viola View Drop Down
Newbie
Newbie


Joined: 06-Jan-2009
Location: Singapore
Posts: 7
Post Options Post Options   Quote viola Quote  Post ReplyReply Direct Link To This Post Topic: Custom ServiceProxyEvents for setting Timeout
    Posted: 19-Mar-2012 at 11:32pm
Hi,
 
As i read this article and learnt how timeout can be reset -
I'd like to know whether it is possible to customize the settings programmatically within different scope? For instance,
 
TimeSpan originalTimeOut = endpoint.Binding.SendTimeout;
try
{
{// scope 1, for operation 1
    endpoint.Binding.SendTimeout = timeoutBigVal;
    DoSomeWorkThatTakesVeryLong();
{// scope 2, for operation 2
     endpoint.Binding.SendTimeout = timeoutSmallVal;
     DoSomeOtherWorkNotVeryTimeConsuming();
}
}
finally
{// then set back for all other methods to go as usual
    endpoint.Binding.SendTimeout = originalTimeOut;
}
 
Also, I'd like to confirm this behavior because I noticed that setting "endpoint.Binding.SendTimeout" in code(CustomServiceProxyEvents:OnEndpointCreated) is not the equivalent to setting only the  SendTimeout ="<value>" in config file. Because the former worked for my simulation but the later failed with an exception about "client channel timeout". So internally this SendTimeout for the binding in code will overwrite the different operationTime of client channel too? Please explain. Thanks a lot! 
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 20-Mar-2012 at 11:34am
Hi Viola,
 
What version of DevForce are you using?
 
Regards,
   Silvio.
Back to Top
viola View Drop Down
Newbie
Newbie


Joined: 06-Jan-2009
Location: Singapore
Posts: 7
Post Options Post Options   Quote viola Quote  Post ReplyReply Direct Link To This Post Posted: 20-Mar-2012 at 7:26pm
The latest, 6.1.6.
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 22-Mar-2012 at 4:38pm
Hi viola,
 
Apparently, after the binding is used your changed configurations will not take any effect. (http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/b851a558-0afd-4dfb-b9cf-941668868828/)
 
For the second issue you described, can you clarify? What is the full exception message you are getting?
 
Also, there is a topic in the DevForce Resource Center that explains how to handle timeouts.
 
Regards,
   Silvio.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down