如何增加wcf服务执行超时 [英] how to increase wcf service execution Timeout

查看:126
本文介绍了如何增加wcf服务执行超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i是wcf中的新手,

i开发了wcf服务,执行任务并完成任务但却出错。

错误是:



请求频道在00:00:58.8637728之后等待回复时超时。增加传递给Request的调用的超时值或增加Binding上的SendTimeout值。分配给此操作的时间可能是较长超时的一部分。



请建议帮助如何详细增加执行时间。


i am new in wcf,
i have developed wcf service which execute task and complete the task but it gives error.
error is :

The request channel timed out while waiting for a reply after 00:00:58.8637728. 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.

please suggest help how to increase execution time in detail.

推荐答案

我建​​议您首先评估一下您的处理时间是否超过一分钟。如果不是那么你就会遇到不同的问题。



如果您的处理时间过长(并且您不能花费更少的时间)那么您将需要设置绑定描述并更改其中的超时值。



以下是配置绑定的一个足够好的示例。但请记住,这只是一个例子。它有时间值,但你不能只是开始使用它而不至少看其余部分。



Windows Communication Foundation快速入门 - 多重绑定VS2010 [ ^ ]
I would suggest that you should first evaluate if your processing time is in fact taking more than one minute. If it isn't then you have a different problem.

If your processing time is taking that long (and you can't make it take less time) then you will need to set up a binding description and change the timeout value in there.

Following is a good enough example of a configuration binding. However keep in mind it is ONLY an example. It has the timing values but you can't just start using it without at least looking at the rest of it.

Windows Communication Foundation QuickStart - Multiple Binding VS2010[^]


Something为null。弄清楚它是什么并修复它。
Something is null. Figure out what it is and fix it.


试试这个

try this
SeriveClient client=new ServiceClient();
    var time = new TimeSpan(0, 3, 0);
    client.Endpoint.Binding.CloseTimeout = time;
                client.Endpoint.Binding.OpenTimeout = time;
                client.Endpoint.Binding.ReceiveTimeout = time;
                client.Endpoint.Binding.SendTimeout = time;


这篇关于如何增加wcf服务执行超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆