1

私の wcf サービスの web.config は次のようになります。

設定が正しく使用されていることをどのように確認できますか?

SendTimeout = 10 minutes などのバインディングを使用するように構成しているにもかかわらず、このタイムアウト エラーが発生することがあります。

<system.serviceModel>
    <services>
      <service behaviorConfiguration="MyService.MyServiceBehavior"
        name="MyService.MyService">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="longTimeoutBinding"
          bindingName="" contract="MyService.IMyService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="longTimeoutBinding" closeTimeout="00:05:00" openTimeout="00:05:00"
          receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="1048576" maxReceivedMessageSize="67108864">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>

    <behaviors>
      <serviceBehaviors>
        <behavior name="MyService.MyServiceBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

私のクライアント (Windows サービス) app.config は次のようになります。

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IMyService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="1048576" maxReceivedMessageSize="67108864"
          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>
    </bindings>
    <client>
      <endpoint address="http://local/MyService/MyService.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyService"
        contract="MyService.IMyService" name="BasicHttpBinding_IMyService" />
    </client>
  </system.serviceModel>
4

2 に答える 2

0

クライアント側の構成でタイムアウト値を設定してみてください。

于 2009-01-14T19:35:41.740 に答える
0

クライアントで sendTimeout を 10 分に設定するとどうなるでしょうか?

于 2009-01-15T14:18:15.953 に答える