I have a silverlight application that is trying to call a WCF service. Everything in the applications works fine except for a method which takes some 3 minutes to process and causes a Timeout error with the error message "The HTTP request to 'http://localhost:60800/myWCF.svc' has exceeded the allotted timeout. The time allotted to this operation may have been a portion of a longer timeout."
I hae tried to change the timeout values in the binding at both ends i.e. Silverlight application and web.config like:
In ServiceReferences.ClientConfig in Silverlight application:
<
<binding name="BasicHttpBinding_myWCF" receiveTimeout="00:20:00" openTimeout="00:20:00" closeTimeout="00:20:00"
sendTimeout="00:20:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
and in the web.config of the WCF service:
maxBufferSize="
</
the web service method still times out after 1 minute and raises an exception in the client.
Also the
is present in the web.config on the service.
I have also tried raising the executionTimeout of the httpRuntime tag to more than 5 minutes but to no avail. I am using Visual Studio 2008 and test the application using rhe ASP.NET development server (That tiny application that starts in the system tray) for development.
Please help me with this error. I ahve tried in vain and can't figure out a way to deal with this error.
Thanks,
Sid
'http://localhost:60800/myWCF.svc'
if the service is active at this location you should see a service discovery HTML page.
If not, then your application is not configured correctly.
A simple way to do this would be to create a static class or singleton class that has a DispatcherTimer which would fire on an interval that makes sense (like 5 minutes). Then in ASP.Net create a simple page that does nothing (or for fun you could just return the current session ID). Then use the WebClient to request that page whenever the timer tick event fires. You could use DownloadStringAsync and pass the url to your page that returns the sessions ID and check to make sure you're on the same session.
OR
You can use Dispatcher timer object in Silverlight application.
You can check that timer and attach a tick event with that.
In your silverlight application set some flags and in timer's tick event check them .
According to thier status call a javascript function which will invoke some server side stuff and will raise timeout.
You could create a WCF web service that has a KeepAlive method and just call that from a DispatchTimer. Once you've done that, it would be pretty tempting to add Logon and Logoff methods. :)
This can be set in the node of the ServiceReference.ClientConfig file in the silverlight app.
Thanks, Peter for your response. My application is running fine. I have many methods in the WCF web service that get called successfully in the Silverlight application. The Service discovery HTML page is also available. There is a problem with only one method which times out because it sometimes takes longer than a minute.
After I realized that I may need more time for this operation in my web service I set timeout values in the binding at both ends of communication to overide the default 1 minute. The operation is till timing out.
Can you shed any light on why the timeout values arenot in effect?
Thanks
Thanks CAP for your response. I have already set these timout values in the ServiceRweference.ClientConfig file in Silverlight App as I had mentioned in my question. The Timeout is still occuring before the specified value.