用的是WCF做了个服务让一个网站通过这个服务去访问数据等操作,即使所请求的操作已经完成,
页面停留时间长不操作,再访问就报下面这个错:从另一方收到未进行安全处理或安全处理不正确的错误。有关错误代码和详细信息,请参见内部 FaultException.
System.ServiceModel.CommunicationObjectFaultedException: 通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。Server stack trace:  
  在 System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen()
  在 System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
  在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
  在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
  在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
  在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)Exception rethrown at [0]:  
  在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
  在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
  在 Ris.IWCFDAL.IWCFDictionaryDAL.GetDictionaryList()上面是报的错

解决方案 »

  1.   

    是不是WCF要发送的数据超出了WCF所允许发送的最大数据,修改配置看看
    参考:    <binding name="Biz.Services.FileUpload.customBinding0">
         <binaryMessageEncoding maxReadPoolSize="2147483647" maxWritePoolSize="2147483647"
          maxSessionSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
           maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
         </binaryMessageEncoding>
         <httpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          keepAliveEnabled="true" maxBufferSize="2147483647" />
        </binding>
    注意maxArrayLength、maxReceivedMessageSize属性值另参考:http://blog.csdn.net/guohouchang/archive/2009/08/07/4420854.aspx
      

  2.   

    看这个错误:System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen()
    有可能是当建立客户端代理以后,长时间不去使用,就会出现出错状态,进而无法使用试试重新连接或者重新实例化一个客户端代理,把以前的销毁掉~~~
      

  3.   

    一个连接对象使用完就关闭,需要使用时再重新实例化。或者修改我记的是OpenTimeOut属性