WCF を使用して 50MG ファイルをアップロードする最良の方法は何ですか?
MTOMが自動的に処理してくれると思っていました。
私が間違っていたと思います...
LocalHost で実行していても例外が発生します
(外部 IIS を使用するのはさらに悪いと思います)。
例外メッセージ:
「 http://localhost:7064/DataSyncService.svcへの HTTP 応答を受信中にエラーが発生しました 。これは、サービス エンドポイント バインディングが HTTP プロトコルを使用していないことが原因である可能性があります。これは、HTTP 要求コンテキストが中止されたことが原因である可能性もあります。 (おそらくサービスのシャットダウンが原因です。詳細については、サーバー ログを参照してください。)
サーバー構成:
<system.serviceModel>
<client>
<remove contract="IMetadataExchange" name="sb" />
</client>
<bindings>
<wsHttpBinding>
<binding name="DataSyncBinding" messageEncoding="Mtom" maxReceivedMessageSize ="50000000" maxBufferPoolSize="50000000">
<readerQuotas maxArrayLength="50000000" />
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="Server.DataSyncServiceBehavior" name="Server.DataSyncService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="DataSyncBinding" name="DataSyncService"
contract="Server.IDataSyncService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Server.DataSyncServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
</system.serviceModel>
クライアント構成:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="DataSyncService" closeTimeout="00:05:00" openTimeout="00:05:00"
receiveTimeout="00:30:00" sendTimeout="00:30:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:7064/DataSyncService.svc"
binding="wsHttpBinding" bindingConfiguration="DataSyncService"
contract="DataSyncServiceReference.IDataSyncService" name="DataSyncService" />
</client>
</system.serviceModel>
ありがとうございます。