WCF/WF - Timeout in calling WCF service from Silverlight app

Asked By Sidhartha Grover
23-Mar-09 03:48 PM

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:

<basicHttpBinding>

<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:

<bindings>

<basicHttpBinding>

<binding name="Binding1" receiveTimeout="00:20:00" sendTimeout="00:20:00" openTimeout="00:20:00" closeTimeout="00:20:00"

maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"/>

</basicHttpBinding>

</bindings>

the web service method still times out after 1 minute and raises an exception in the client.

Also the

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

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

Try requesting the service endpoint in your browser  Try requesting the service endpoint in your browser

23-Mar-09 09:33 PM

'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.

  Santhosh N replied to Sidhartha Grover
23-Mar-09 10:42 PM
You even need to change the timeout in the webserver configuration in IIS...
It should be available in Virtual directory properties

READ THIS  READ THIS

24-Mar-09 03:31 AM

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.

 

 

OR

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. :)

READ THIS  READ THIS
24-Mar-09 03:32 AM

This can be set in the node of the ServiceReference.ClientConfig file in the silverlight app.

Application is configured  Application is configured
24-Mar-09 09:27 AM

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

Already done that.  Already done that.
24-Mar-09 09:33 AM

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.

Thanks,

Put your timeout in the web.config at the server side  Put your timeout in the web.config at the server side
24-Mar-09 12:33 PM
<configuration>  
 <system.web>
   <httpRuntime executionTimeout="240" maxRequestLength="4096"
 useFullyQualifiedRedirectUrl="false"
 minFreeThreads="8"
 minLocalRequestFreeThreads="4"
 appRequestQueueLimit="100" />
 </system.web>
</configuration>
Create New Account
help
visual studio installation problem Actually, my OS is Windows Xp with service pack2.I added service pack3 to install visual studio2010.after that i tryed to installed, but am getting SETUP FAILED due to "Windows XP is not installed. [08 / 10 / 11, 14:26:00] VS70pgui: [2] DepCheck indicates Microsoft Visual F# 2.0 Runtime was not attempted to be installed. [08 / 10 / 11, 14:26:00] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio Macro Tools was not attempted to be installed. [08 / 10 / 11, 14:26:00] VS70pgui attempted to be installed. [08 / 10 / 11, 14:26:01] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio 2010 Professional - ENU was not attempted to be installed. [08 / 10 / 11, 14:26:01
SilverLight What is SilverLight, its concept, why to use it and how to use it What is Silverlight? Silverlight is a new cross-browser, cross-platform implementation of the .NET Framework for building and browsers, including Microsoft Internet Explorer, Mozilla Firefox, Apple Safari, Opera. The plugin required to run Silverlight is very small in size hence gets installed very quickly. It is combination of different platform that allows you to select tools and the programming language you want to use. Silverlight integrates seamlessly with your existing Javascript and ASP.NET AJAX code to complement functionality which you have already created. Silverlight aims to compete with Adobe Flash and the presentation components of Ajax . It also competes with Sun Microsystems' JavaFX, which was launched a few days after Silverlight. Currently there are 2 versions of Silverlight: Silverlight 1.0 : Silverlight 1.0 consists of
how to do reporting services in visual studio 2008 hi frds how can we do reporting service in visual studio 2008 hi. . SSRS 2008 Tutorial: The Reporting Services Architecture Reporting Services has a quite a few components that work report definitions. Reports themselves can make use of data from many different data sources. SSRS 2008 Tutorial: Using Report Designer Reporting Services includes two tools for creating reports: • Report Designer can
MS Visual Studio 2008 Installation Hi All Im trying to install MS Visual Studio on my computer.(OS is MS Server 2003). But Im getteing following error message. "Setup not installed. [01 / 12 / 10, 14:33:59] VS70pgui: [2] DepCheck indicates Microsoft Document Explorer 2008 was not attempted to be installed. [01 / 12 / 10, 14:33:59] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio Web Authoring Component was not attempted to be installed. [01 / 12 / 10, 14:33:59