timeout error from windows workflow - wcf

When i call an recevive activity in Workflow, it is showing timeout error after 1 minute.
I tried to increase the timeout by modifying the web.config as follows, but no use.
<bindings>
<basicHttpBinding>
<binding name="longTimeoutBinding" closeTimeout="10:01:00" openTimeout="10:01:00" maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="10:10:00" sendTimeout="10:10:00" >
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
I have similar problem with one of WCF service also when it fectes large number of data.
Can anyone help me to find out what i am missing here.

Have you also set these values on the client side? It could be that the client gives up waiting for a reply.
Could you try and reduce the timeout to 15 seconds to verify that these configs are the ones that are used.
Could you also post the exception that you get

Related

The maximum message size quota for incoming messages (65536) has been exceeded - set maxReceivedMessageSize="2147483647" updated but not working

added maximum size on web config, but still showing the same error.
ERROR IMAGE
You need to set maxReceivedMessageSize both in your server-side and client-side. The code like this:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxBufferSize="64000000" maxReceivedMessageSize="2147483647" />
</basicHttpBinding>
</bindings>
</system.serviceModel>

Message size quota exceeded on WCF netTcpBinding in remote machine

Always getting exception "The maximum message size quota for incoming messages has been exceeded for the remote channel. See the server logs for more details", in .net c# wcf windows application development.
Up to approximate 72kb size data in DataTable I am able to send remote machine hosting WCF in windows service successfully. But above that throwing exception "The maximum message size quota for incoming messages has been exceeded for the remote channel. See the server logs for more details".
Already did setup of data size management both end.
Client-end App.config:
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IProjectService"
maxBufferSize="2147483647" maxBufferPoolSize="524288"
maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647"/>
</binding>
</netTcpBinding>
</bindings>
Remote server-end App.config:
<netTcpBinding>
<binding name="NetTcpBinding_IProjectService" maxBufferSize="2097152"
maxBufferPoolSize="2097152"maxReceivedMessageSize="2097152">
<readerQuotas maxStringContentLength="2097152" />
</binding>
</netTcpBinding>
Also tried same sizes i.e."2147483647" both-end but with same exception always.
Please consider the below configuration.
<bindings>
<netHttpBinding>
<binding name="mybinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647"/>
</binding>
</netHttpBinding>
</bindings>
Moreover, please apply the configuration in the service endpoint by using BindingConfiguration name.
<services>
<service name="sv">
<endpoint bindingConfiguration="mybinding" address="" binding="netTcpBinding" contract="isv" ></endpoint>
</service>
</services>
Please apply the configuration on both the serve-end and the client-end.
Feel free to let me know if the problem still exists.

Sending large file (>10 MB) through WCF rest service

Previously I am sending file (less than 63 KB ) through WCF Rest service then it send successfully but when the file size is greater than 65 KB, it throws an exception. After that I configure the web.config file like below and it works fine.
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="10485760">
<readerQuotas/>
</binding>
</webHttpBinding>
</bindings>
Now i am sending 10 MB file and also increase the size in web.config file but got the same exception.
I added below configuration setting :
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" >
<readerQuotas maxStringContentLength="525288"></readerQuotas>
</binding>
</webHttpBinding>
</bindings>
What is needed to fix this?
I guess you receive this error on client side. remember you have to set the max size at client side!!!
Read Derek's answer. Thats really helpfull.

Page crahses if repsonse time is more

Im using Silverlight with wcf for my application. When the page requests it goes to the service for the output. But if the response(database operation) takes a bit of time to provide the output then my silverlight page is getting crashed. Can any help me what is the problem.
Sounds like you need to set the timeout settings for the WCF service to be higher to cater for the potential delays. The timeout settings are usually set in the bindings defined in the
<system.serviceModel>
<bindings>
section of the config file.
You will need to make sure that the 'receiveTimeout' in the client config, and the 'sendTimeout' in the service config are set to appropriate values that are high enough to cater for your particular service's timings.
An example 'basicHttpBinding' for the client-side, with a 'receiveTimeout' of 1 minute, 30 seconds could look like this (the important item to note being the 'receiveTimeout'):
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBindingConfig" receiveTimeout="00:1:30">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>

WCF Service , how to increase the timeout?

Might seem like a silly question, but everything in WCF seems a lot more complicated than in asmx, how can I increase the timeout of an svc service?
Here is what I have so far:
<bindings>
<basicHttpBinding>
<binding name="IncreasedTimeout"
openTimeout="12:00:00"
receiveTimeout="12:00:00" closeTimeout="12:00:00"
sendTimeout="12:00:00">
</binding>
</basicHttpBinding>
</bindings>
And then my endpoint gets mapped like this:
<endpoint address=""
binding="basicHttpBinding" bindingConfiguration="IncreasedTimeout"
contract="ServiceLibrary.IDownloads">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
The exact error I am getting:
The request channel timed out while waiting for a reply after 00:00:59.9990000. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.
In the WCF Test Client, there is a config icon that contains the run time configuration of my service:
As you can see its not the same values as I've set for it? What am I doing wrong?
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IDownloads" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
In your binding configuration, there are four timeout values you can tweak:
<bindings>
<basicHttpBinding>
<binding name="IncreasedTimeout"
sendTimeout="00:25:00">
</binding>
</basicHttpBinding>
The most important is the sendTimeout, which says how long the client will wait for a response from your WCF service. You can specify hours:minutes:seconds in your settings - in my sample, I set the timeout to 25 minutes.
The openTimeout as the name implies is the amount of time you're willing to wait when you open the connection to your WCF service. Similarly, the closeTimeout is the amount of time when you close the connection (dispose the client proxy) that you'll wait before an exception is thrown.
The receiveTimeout is a bit like a mirror for the sendTimeout - while the send timeout is the amount of time you'll wait for a response from the server, the receiveTimeout is the amount of time you'll give you client to receive and process the response from the server.
In case you're send back and forth "normal" messages, both can be pretty short - especially the receiveTimeout, since receiving a SOAP message, decrypting, checking and deserializing it should take almost no time. The story is different with streaming - in that case, you might need more time on the client to actually complete the "download" of the stream you get back from the server.
There's also openTimeout, receiveTimeout, and closeTimeout. The MSDN docs on binding gives you more information on what these are for.
To get a serious grip on all the intricasies of WCF, I would strongly recommend you purchase the "Learning WCF" book by Michele Leroux Bustamante:
Learning WCF http://ecx.images-amazon.com/images/I/51GNuqUJq%2BL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg
and you also spend some time watching her 15-part "WCF Top to Bottom" screencast series - highly recommended!
For more advanced topics I recommend that you check out Juwal Lowy's Programming WCF Services book.
Programming WCF http://ecx.images-amazon.com/images/I/41odWcLoGAL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg
The best way is to change any setting you want in your code.
Check out the below example:
using(WCFServiceClient client = new WCFServiceClient ())
{
client.Endpoint.Binding.SendTimeout = new TimeSpan(0, 1, 30);
}
The timeout configuration needs to be set at the client level, so the configuration I was setting in the web.config had no effect, the WCF test tool has its own configuration and there is where you need to set the timeout.
Got the same error recently but was able to fixed it by ensuring to close every wcf client call.
eg.
WCFServiceClient client = new WCFServiceClient ();
//More codes here
// Always close the client.
client.Close();
or
using(WCFServiceClient client = new WCFServiceClient ())
{
//More codes here
}