none
通信对象System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。 RRS feed

  • 问题

  • <!--服务器端的配置如下: -->

    <services>
          <service name="SQS.Demo.Server.Ticket" behaviorConfiguration="TicketBehavior">
            <endpoint address="TicketService" binding="netTcpBinding" bindingConfiguration="TicketBindingConfiguration" contract="SQS.Demo.Contract.ITicket" />
            <endpoint address="mex" contract="IMetadataExchange" binding="mexTcpBinding" />
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://192.168.20.114:9001"/>
              </baseAddresses>
            </host>
          </service>

          <service name="SQS.Demo.Server.Hotel" behaviorConfiguration="TicketBehavior">
            <endpoint address="HotelService" binding="netTcpBinding" bindingConfiguration="TicketBindingConfiguration" contract="SQS.Demo.Contract.IHotel" />
            <endpoint address="hotel" contract="IMetadataExchange" binding="mexTcpBinding" />
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://192.168.20.114:9001"/>
              </baseAddresses>
            </host>
          </service>

        </services>

        <behaviors>
          <serviceBehaviors>
            <behavior name="TicketBehavior">
              <serviceThrottling maxConcurrentCalls="5000" maxConcurrentSessions="5000" maxConcurrentInstances="5000"/>
              <serviceMetadata httpGetEnabled="false"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>

        <bindings>
          <netTcpBinding>
            <binding  name="TicketBindingConfiguration"  openTimeout="00:30:00" receiveTimeout="00:30:00"  sendTimeout="00:30:00"  maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
              <security mode="None" />
              <readerQuotas  maxStringContentLength="6553600" maxArrayLength="6553600" />
            </binding>
          </netTcpBinding>
        </bindings>



    <!--客服端的配置如下:-->

    <client>
          <endpoint address="net.tcp://192.168.20.114:9001/TicketService"
           binding="netTcpBinding" bindingConfiguration="NetTcpBinding_TicketService1"
           contract="ServiceTicket.TicketService" name="NetTcpBinding_TicketService1" />
    </client>

    2010年2月28日 1:30

答案

  • 我的那个问题就是你说的那种,一会儿不运行,它就出现这种错误,请问一下,像这样的问题该怎么解决呢?

    你的receiveTimeout="00:30:00"已经设置为30分钟了。
    现在把InactivityTimeout也设置为30分钟就可以了。

    通道闲置时间太久 也会出错。

    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
    欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
    欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
    欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
    • 已标记为答案 Mog Liang 2010年3月5日 7:46
    2010年3月1日 11:45
    版主

全部回复