1

私は、JSON データを別の .NET アプリケーションからの HTTP Post として受け入れる .NET WCF サービスを使用しています。

少量のデータを投稿すると、すべて正常に動作します (最大 65kb のデータ)

ただし、それ以上投稿しようとすると、サービス側で内部サーバー エラーが発生します。

すべてが、サービスが最大 65kb 相当のデータの受け入れに制限されていることを示しています。

maxrequestmessagesize 属性を使用してより多くのデータを受け入れるように構成ファイルを変更することについて読んだことがありますが、問題は、web.config に表示できるバインディングがないことです。

サービスに関連する構成ファイルにあるものは次のとおりです

<system.serviceModel>

    <behaviors>

      <serviceBehaviors>
        <behavior>
          <!-- 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>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

その 65 k の制限を超えるために何をすべきかわかりません。

ありがとう

4

2 に答える 2

2

あなたの設定でこれを使用してください:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ImyService"
                maxBufferPoolSize="2147483647"
                maxReceivedMessageSize="2147483647">
            </binding>
        </basicHttpBinding>
    </bindings>

</system.serviceModel>
于 2013-02-19T18:38:57.270 に答える
1

ざっと見てみると、WCF サービスの「要求サイズ バーを上げる」ために、さまざまな場所に 4 つの設定があります。

maxarraylength (binding/readerquotas タグ) maxbuffersize (バインディング タグ) maxreceivedmessagesize (バインディング タグ) maxrequestlength (system.web/httpruntime タグ)

構成にバインドがない理由がわかりません。おそらく、指定されていない場合、デフォルト値が使用されますか? サービス/サービス/エンドポイント タグはありますか? おそらく、コードを介してこれらを設定していますか?

于 2013-02-19T18:35:38.630 に答える