4

私のapp.configを見て少し混乱しました。次のようになります。

<system.serviceModel>

<servcies>

    <service>

        <endpoint address="" binding="basicHttpBinding">
            <identity>
                           <dns value="localhost"
            </identity>
        <endpoint>

    </service>



</services>
<behaviors>
    <serviceBehaviors>

        <behavior>
            ...
        </behavior>

    </serviceBehaviors>
</beharviors>

</system.serviceModel>

SendTimeout 値を 1 分よりも大きく設定するには、バインディング タグをどこに追加すればよいですか?

4

1 に答える 1

21

以前の質問で IceLava が示したように、サーバーの .config ファイルにバインディング セクションを設定します。

  <bindings>
    <netTcpBinding>
    <binding name="longTimeoutBinding"
        receiveTimeout="00:10:00" sendTimeout="00:10:00">
      <security mode="None"/>
    </binding>
    </netTcpBinding>
   </bindings>

上記の例では、行動のすぐ下に置くことができます。

次に、エンドポイント構成で、プロパティ bindingConfiguration = "longTimeoutBinding" を使用してそのバインディングへの参照を追加します。

このようなもの:

<endpoint address="" bindingConfiguration="longTimeoutBinding" binding="basicHttpBinding">
        <identity>
                   <dns value="localhost" />
        </identity>
<endpoint>

Juval Lowy 著の Programming WCF Services をお持ちの場合は、28 ~ 29 ページ (第 2 版) で詳細を確認できます。

于 2009-01-08T19:58:17.697 に答える