0

私のシステム要求:Webサービスエラー:HTTP 413:エンティティが大きすぎ

は、IISを7.5

のVisual Studio 2010

Frameworkの私は、ファイルを受信Webサービスを作成してもらって4

(バイト配列)。 私はそれを消費するコンソールアプリケーションを作成しています(Add Service Reference - > Advance - > Add Web Reference)。 httpで完全に動作しています。しかし、私はhttpsでそれを消費する必要があります。だから、HTTPSでそれを消費しようとすると、HTTP 413:リクエストエンティティが大きすぎます。私はたくさんの読書をしてきましたが、それは不可能です。私はWebサービスのwebconfigに入れようとしました:

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="BasicHttpBinding_INopService" maxReceivedMessageSize="22147483647" maxBufferPoolSize="252428800" maxBufferSize="22147483647"> 
      <readerQuotas maxDepth="256" maxStringContentLength="22147483647" maxArrayLength="2222216384" 
      maxBytesPerRead="2222220000" maxNameTableCharCount="2222216384" ></readerQuotas> 
     </binding> 
     </basicHttpBinding> 

<basicHttpBinding> 
     <binding name="HttpBigMessage" 
      receiveTimeout="00:10:00" 
      sendTimeout="00:10:00" 
      maxReceivedMessageSize="2147483647" > 
      <security mode="None" /> 
     </binding> 
     </basicHttpBinding> 

    </bindings> 

    <client> 
     <endpoint address="https://localhost/hmenu/GetData.asmx" 
     binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_INopService" 
     contract="PhotoSavingsService.INopService" name="BasicHttpBinding_INopService" /> 
    </client> 


    </system.serviceModel> 

ファイルが大きすぎます。 どこに最大サイズを入れる必要がありますか?

は、行を追加することで

+0

を固定した後、問題web.configファイルは、こちらをご覧http://stackoverflow.com/questions/22094701/maxrequestlength-in-web-config-makes-an-internal-error –

+0

ない方法があります。私はtrueを返すダミーメソッドを作成してもらって、それは同じ起こっている... – Za7pi

+1

は、このを見てみましょうhttps://blogs.msdn.microsoft.com/dsnotes/2015/08/21/large-file-はい/ –

答えて

0

多くの時間をありがとうござい

<httpRuntime maxRequestLength="214748364" executionTimeout="9999" 
targetFramework="4.5"/> 

500は、エラー

出回っウェブ 設定ファイルに は、一般的に500エラーが場合に発生 こんにちはみんなを存在させてご覧ください与えます最初に修正された web.configの設定が間違っています。これが作られた問題はRestServiceBindingConfigトランスポートモードで

<bindings> 
    <webHttpBinding> 
    <binding name="RestServiceBindingConfig"> 
     <security mode="Transport"></security> 
    </binding> 
    <binding name="HttpRestServiceBindingConfig"> 
     <security mode="None"></security> 
    </binding> 
<binding maxBufferPoolSize="76000000" maxReceivedMessageSize="19000000"> 
     <readerQuotas maxDepth="32" maxStringContentLength="19000000" 
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> 
    </binding> 
    </webHttpBinding> 
</bindings> 
<behaviors> 

我々だけで貼り付けコピーreaderquotas maxBufferPoolSize maxReceivedMessageSize を固定する前にここで 私は413エンティティを提供していますが

web.configファイルを修正httpsプロトコルの問題には大きすぎますトリックが最初に RestServiceBindingConfigはhttps秒のためのものですHttpRestServiceBindingConfig HTTPのバインド

<bindings> 
    <webHttpBinding> 
    <binding name="RestServiceBindingConfig" maxBufferPoolSize="2147483647" 
maxReceivedMessageSize="2147483647"> 
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" 
      maxArrayLength="2147483647" maxBytesPerRead="4096" 
      maxNameTableCharCount="16384" /> 
     <security mode="Transport"></security> 
    </binding> 
    <binding name="HttpRestServiceBindingConfig" 
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" 
      maxArrayLength="2147483647" maxBytesPerRead="4096" 
      maxNameTableCharCount="16384" /> 
     <security mode="None"></security> 
    </binding> 

    </webHttpBinding> 
</bindings> 
<behaviors> 
+0

親切に答えを編集すると、そのコードがあなたの説明と混ざり合っているのを見ることができます。解説からコードを分離すれば完璧です –

関連する問題