83

いくつかのテーブルのスコープを作成しているときにこの例外が発生します。これらのテーブルはすべて設計上巨大です

<bindings>
    <wsHttpBinding>
        <binding name="wsHttpBinding_ISyncServices" closeTimeout="00:10:00"
            openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
            transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
            <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647"
                maxNameTableCharCount="2147483647" />
            <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
            <security mode="Message">
                <transport clientCredentialType="Windows"
                    proxyCredentialType="None" realm="">
                    <extendedProtectionPolicy policyEnforcement="Never" />
                </transport>
                <message clientCredentialType="Windows"
                    negotiateServiceCredential="true" algorithmSuite="Default" />
            </security>
        </binding>
    </wsHttpBinding>
</bindings>

私はMaxReceivedMessageSize2147483647にしましたが、それでもこの行で以下の例外を与えています

 client.GetTableDescription(scopeName, syncTable)

受信メッセージの最大メッセージ サイズ クォータ (65536) を超えました。
クォータを増やすには、適切なバインド要素で MaxReceivedMessageSize プロパティを使用します。

4

8 に答える 8

115

この質問の答えによると

あなたはこのようなものが欲しいでしょう:

<bindings>
     <basicHttpBinding>
         <binding name="basicHttp" allowCookies="true"
 maxReceivedMessageSize="20000000"
 maxBufferSize="20000000"
 maxBufferPoolSize="20000000">
             <readerQuotas maxDepth="32"
 maxArrayLength="200000000"
 maxStringContentLength="200000000"/>
         </binding>
     </basicHttpBinding> </bindings>

そこに受け入れられた答えへのコメントも読んでください、それらは貴重なインプットを含んでいます。

于 2011-03-28T13:33:45.383 に答える
13

You need to make the changes in the binding configuration (in the app.config file) on the SERVER and the CLIENT, or it will not take effect.

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding maxReceivedMessageSize="2147483647 " max...=... />
        </basicHttpBinding>
       </bindings>
</system.serviceModel>
于 2011-03-28T14:39:43.273 に答える
12

maxBufferSizeも増やす必要があります。また、 readerQuotasを増やす必要があるかもしれないことに注意してください。

于 2011-03-28T13:32:43.903 に答える
6

これは私のために働いた:

 Dim binding As New WebHttpBinding(WebHttpSecurityMode.Transport)
 binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None
 binding.MaxBufferSize = Integer.MaxValue
 binding.MaxReceivedMessageSize = Integer.MaxValue
 binding.MaxBufferPoolSize = Integer.MaxValue
于 2015-04-10T17:27:20.653 に答える
0

私の解決策は、クエリで「-OutBuffer 2147483647」パラメーターを使用することでした。これは、共通パラメーターの一部です。PS C:> Get-Help about_CommonParameters -Full

于 2015-08-19T18:32:24.913 に答える
0

私の場合、web.config/の設定app.configは無視されました。バインディングを手動で作成することになり、問題は解決しました。

var httpBinding = new BasicHttpBinding()
{
    MaxBufferPoolSize = Int32.MaxValue,
    MaxBufferSize = Int32.MaxValue,
    MaxReceivedMessageSize = Int32.MaxValue,
    ReaderQuotas = new XmlDictionaryReaderQuotas()
    {
        MaxArrayLength = 200000000,
        MaxDepth = 32,
        MaxStringContentLength = 200000000
    }
};
于 2019-02-12T06:00:41.013 に答える