0

プロジェクトに重大な問題があります。(wcf + netTCP) でのトランザクション中に例外が発生しました。

The communication object, 
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel, 
cannot be used for communication because it is in the Faulted state.

WCF サービスの app.config で、タイムアウトを指定したバインディング タグを追加します。しかし、私の取引は10分以内に終了しました。なにが問題だったの..

 <bindings>
      <basicHttpBinding>
        <binding name="ServiceSoap" closeTimeout="0:01:00" openTimeout="0:01:00" receiveTimeout="10:00:00" sendTimeout="10:00:00" allowCookies="false"
          bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
      <netTcpBinding>
        <binding name="b1" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="infinite" sendTimeout="10:00:00"

transferMode="Buffered"

maxBufferPoolSize="524288"

maxBufferSize="65536"

maxConnections="10"

maxReceivedMessageSize="65536">
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>

誰でも私を助けてください!!!!..

4

3 に答える 3

4

タイムアウトの問題だと思う理由がわかりませんか?エラー メッセージは、タイムアウトが発生したことを示唆していません。サーバーが例外をスローしている可能性はありますか?

WCF トレースを設定することを強くお勧めします。少し複雑ですが、多くのあいまいなWCFの問題を解決したので、本当にやりがいがあります。

于 2011-04-07T13:31:34.620 に答える
1

これは完全な答えではありませんが、同じマシンでクライアントとサーバーを使用している場合は、netTcp の代わりに名前付きパイプ バインディングを使用できます。

構成のバインディング セクションは次のようになります。

<netNamedPipeBinding>
  <binding name="infiniteOpenBindingConfig" receiveTimeout="infinite" closeTimeout="infinite">
  </binding>
</netNamedPipeBinding>

バインディングを無期限に維持するには、サーバーとクライアントの両方で上記の構成を設定する必要があります。

于 2011-04-07T07:51:13.333 に答える