Silverlight-WCF Timeout Setting code

While working with Silverlight-WCF many time we come across error ……….

“The HTTP request to <URL to WCF Service> has exceeded the allotted timeout. The time allotted to this operation may have been a portion of a longer timeout.”

This may be due to speed of server or database operations taken in WCF Service .so to deal with this error we can set time in web.config file.

Below is code for it…

1)      In Web.Config

     <httpRuntime executionTimeout="600" />

 

2)      In Web.Config Binding Elements

 

<binding name="customBindingnew"
   
receiveTimeout="00:15:00"

   
sendTimeout="00:15:00"

   
openTimeout="00:15:00"

   
closeTimeout="00:15:00" />

3)      In ServerReferences.ClientConfig binding elements within the system.serviceModel

 

 <binding name="CustomBinding"
   
receiveTimeout="00:15:00"

   
sendTimeout="00:15:00"

   
openTimeout="00:15:00"

   
closeTimeout="00:15:00" />

 

Thank You.