2012-07-26 90 views
1

我的WCF服务出现问题。程序运行三个小时后,我发现下面的异常。WCF服务中的System.TimeoutException C#

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

我不认为增加超时将是一个解决方案。我认为公正会在几分钟后抛出异常。也许我必须更改监听器服务器上的任何设置。可能是因为我的机器在一段时间后关闭了端口? 我打电话给我的服务这样的:

IServices service = null; 
        service = ChannelFactory<IServices>.CreateChannel(
         new BasicHttpBinding(), 
         new EndpointAddress(
         port)); 
        result = service.addAppointments(appList); 

我的听众:

ServiceHost host = new ServiceHost(service); 
        host.AddServiceEndpoint(typeof(
          IServices), 
          new BasicHttpBinding(), port); 
        host.Open(); 

这就是所有。到目前为止,还没有进一步的设置需要。

+0

向我们展示了如何调用该服务,以及如何得到一个答复。 – oleksii 2012-07-26 08:38:50

+0

您是否在寻找异步服务器调用?火和忘记? – 2012-07-26 08:43:12

+0

在我的情况下,同步解决方案将会很好 – andreaspfr 2012-07-26 08:44:57

回答