asmx Web サービスを使用して IIS7 にデータをインポートする Web アプリケーションに取り組んでいます。Windows サービスでファイルを取得してインポートし、Web サービス経由で送信します。大規模なインポート中に 1 分後に次のエラーが発生します。
リクエスト チャネルは、00:00:59.9843750 の後に応答を待っている間にタイムアウトになりました。Request への呼び出しに渡されるタイムアウト値を増やすか、Binding の SendTimeout 値を増やします。この操作に割り当てられた時間は、より長いタイムアウトの一部であった可能性があります。
それほど長く実行される Web サービス呼び出しを行わないことを提案する投稿をたくさん見てきました。原則として同意しますが、これはトラフィックの少ない内部 Web サイトです。そうでないことが証明されるまで、システムの他の部分を再設計する作業は、タイムアウトを更新するよりも長くなると思います。
これまでのところ、web.config のbasicHttpBindingプロパティ、特に openTimeout、receiveTimeout、sendTimeout、および closeTimeout プロパティを更新しようとしました。挙動に変化はありませんでした。
また、オブジェクトの構築後に Web サービスを呼び出すコードでこれらのプロパティを設定しようとしました。まだ運がありません。
IIS の設定を確認しましたが、現在 60 秒に設定されているタイムアウト値はありません。また、web.config の executionTimeout を上げてみましたが、効果はありませんでした。
不足している構成値は何ですか? タイムアウトを変更する他の方法はありますか?
アップデート:
リクエストに応じて、構成は次のとおりです。
App.config
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ImportServiceSoap" closeTimeout="00:02:00" openTimeout="00:02:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="1265536" maxBufferPoolSize="12524288" maxReceivedMessageSize="1265536"
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://mysite.com/Importservice.asmx"
binding="basicHttpBinding" bindingConfiguration="ImportServiceSoap"
contract="ImportService.ImportServiceSoap" name="ImportServiceSoap" />
</client>
</system.serviceModel>
</configuration>
Web.config (要約、接続文字列を削除):
<configuration>
<appSettings>
<system.web>
<roleManager enabled="false" cacheRolesInCookie="false" defaultProvider="AspNetSqlRoleProvider" />
<siteMap defaultProvider="MenuElementsProvider">
</siteMap>
<compilation debug="false" targetFramework="4.0">
</compilation>
<customErrors mode="RemoteOnly" defaultRedirect="Shared/Internal_Server_Error.html">
<error statusCode="404" redirect="Shared/Internal_Server_Error.html" />
<error statusCode="500" redirect="Shared/Internal_Server_Error.html" />
</customErrors>
<authentication mode="Windows" />
<identity impersonate="true" />
<authorization>
<allow users="*" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.1.0.1" cookieless="false" timeout="30" />
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" />
<httpRuntime maxRequestLength="102400" requestValidationMode="2.0" executionTimeout="14400" />
</system.web>
<location path="DefaultWsdlHelpGenerator.aspx">
<system.web>
<pages styleSheetTheme="" />
<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
</system.web>
</location>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
</appSettings>
</configuration>