views:

5485

answers:

5

I have a client application developed in .net seding a request to wcf service and supposed to send reponse .if execution time with in 1 minute,there is no error,if it exceeds 1 minute the error is Inner exception: This request operation sent to net.tcp://localhost:18001/PitToPort/2008/01/30/StockpileService/tcp did not receive a reply within the configured timeout (00:01:00). The time allotted to this operation may have been a portion of a longer timeout. This may be because the service is still processing the operation or because the service was unable to send a reply message. Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client how to increase the time out and how?What is the best solution.

+3  A: 

The timeout is called "sendTimeout" and you can configure it on your binding section in your config file, or in code - your choice.

config:

  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding sendTimeout="00:03:00" />
      </netTcpBinding>
    </bindings>

This will set the timeout to 3 minutes.

Marc

marc_s
do we need to write on both ends(clien config and server config)?
rmdussa
I have tried with "00:30:00" still I get the errorThe socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:29:57.8030000'.
rmdussa
but really it is not wait 30 minutes,it fails with in 1 minute
rmdussa
on serverside I config like this<binding receiveTimeout="00:30:00" />
rmdussa
You only need to add this on the client side, UNLESS your server itself then also makes calls out to other services.
marc_s
still same error This request operation sent to net.tcp://localhost:18001/PitToPort/2008/01/30/StockpileService/tcp did not receive a reply within the configured timeout (00:01:00). The time allotted to this operation may have been a portion of a longer timeout. This may be because the service is still processing the operation or because the service was unable to send a reply message. Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.
rmdussa
I Have tried to configured (receiveTimeout="00:30:00) still the same error (Timeout)
rmdussa
check my answer. It probably has nothing to do with timeouts. This exception message is EVIL pure and simple.
Yann Schwartz
Thanks, Yann - rmdussa unfortunately didn't really tell us what he was doing, so I didn't think of the various buffer sizes and stuff. Thanks for the heads up!
marc_s
+1  A: 

I have add the following code to the Service app code system.transactions defaultSettings timeout="00:30:00" with this code the service will wait 30 minutes to get process done in database server and increase the maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" in client binding attributes, then it works fine.

Problem :Service is sending response but the client buffersize was less previously,I increased to maximum buffer size.

rmdussa
+9  A: 

Be careful, this error message is a boilerplate string WCF sends when it doesn't have a clue what happened. It really means "mmh something went wrong in the chain but I'm not really sure what, so, here's some trivia about the configuration, do what you want with it".

MOST OF THE TIME when you get this message it has nothing to do with actual timeouts. It can be quotas (number of objects in the graph, overall size, array length) or something that went wrong server-side, between the time your service method returned a result and the actual bytes were sent over the wire. So, you should check your configuration settings (and not the timeout, except if you had to actually wait for one minute to get the error. If you got the error straight away, it has nothing to do with timeouts whatsoever).

This useless message is on top of my list of WCF annoyances.

Yann Schwartz
Am talking out of Practical Experience and 1. the isuue is Timeout(wcf service processing in database server the corresponding procedure is taking more than 2 min) 2. the response returmns list[]size 400 elements,if we try to return 100 elements No error,if we return full list then its thrown error,then we realaize this is because of buffer size. If we are not increase the time in server side still its fails,so in my case have to do both
rmdussa
A: 

If you know why the server is taking more than a minute to respond to the client, then you should extend the OperationTimeout of the channel (as it says in the error message).

Check out this, including a code sample at the end: http://final-proj.blogspot.com/2009/09/wcf-timeouts.html

Good luck.

sq33G
A: 

Here is a far simpler solution... just set the property directly on the current ClientBase. In other words, first add a service reference, initalize it, then set the property "InnerChannel.OperationTimeout"

NetUtilsWCF.SMTPDiagClient sClient = new NetUtilsWCF.SMTPDiagClient();

sClient.InnerChannel.OperationTimeout = new TimeSpan(0, 5, 0);

MakerOfThings7