2016-05-12 11 views
0

このトピックに関する他の記事を見て、すべてを試したと思いますが、大きなファイルを保存しようとするとこのエラーを解決できないようです。私は、maxReceivedMessageSizeと他のすべてのサイズ関連の設定を設定ファイルの両方のセクションでバンプし、IISマネージャーを介してuploadReadAheadSizeをバンプしました。私は何かが欠落しているのを見ないので、設定ファイルを誰かが間違って見つけられるかもしれないことを期待して投稿します。413リクエストエンティティが大きすぎるWCF

サービスの設定:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <configSections> 
     <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c5rge93gerg9" requirePermission="false" /> 
    </configSections> 
    <appSettings> 
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> 
    </appSettings> 
    <system.web> 
     <compilation debug="true" targetFramework="4.5" /> 
     <httpRuntime targetFramework="4.5" maxRequestLength="2147483647" /> 
    </system.web> 
    <system.serviceModel> 
     <client> 
     <endpoint address="/" binding="basicHttpBinding" bindingConfiguration="MyHttpBinding" contract="*" name="Default" /> 
     </client> 
    <bindings> 
     <basicHttpBinding> 
      <binding name="MyHttpBinding" hostNameComparisonMode="Exact" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Streamed"> 
       <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      </binding> 
     </basicHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <protocolMapping> 
     <add binding="basicHttpsBinding" scheme="https" /> 
    </protocolMapping> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
    <system.webServer> 
    <security> 
     <requestFiltering> 
      <requestLimits maxAllowedContentLength="2147483647" /> 
     </requestFiltering> 
    </security> 
    <modules runAllManagedModulesForAllRequests="true" /> 
    <directoryBrowse enabled="true" /> 
    </system.webServer> 
    <connectionStrings> 
    </connectionStrings> 
    <entityFramework> 
     <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> 
    </entityFramework> 
</configuration> 

クライアントの設定の関連部分:

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
      <binding name="MyHttpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 
       <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      </binding> 
     </basicHttpBinding> 
    </bindings> 
<client> 
    <endpoint address="http://Service1.svc" binding="basicHttpBinding" 
    bindingConfiguration="MyHttpBinding" contract="ServiceReference1.IService1" 
    name="MyHttpBinding" /> 
</client> 

+0

ファイルのサイズはどれくらいですか? –

+0

@AmitKumarGhosh約2MBのみ – JSchins

答えて

0

私はあなたのサービスの設定で<services>セクションが表示されないので、あなたがたにも関わらず、より大きな値を持つバインディングが定義されていますが、デフォルトのバインディングとして設定されていないか、エンドポイントに明示的に割り当てられていないため、使用されていません。代わりに、デフォルトのクォータと制限でbasicHttpBindingが取得されています。これは、あなたに「MyHttpBinding」の設定を割り当てます

<services> 
    <service name="MyServiceName"> 
    <endpoint address="/" 
       binding="basicHttpBinding" 
       bindingConfiguration="MyHttpBinding" 
       contract="*" 
       name="Default" /> 
    </service> 
</services> 

:あなたの状況で

、最も簡単な修正は、おそらくサービスの設定ファイルを修正し、<client>セクションを削除して、このような<services>セクションを、追加することです終点。

name属性を省略して、すべてのbasicHttpBindingエンドポイントの "MyHttpBinding"をデフォルトの構成にすることもできます。

関連する問題