2011-10-18 14 views
1

私はWCFサービスを持っています。私は、クライアントアプリケーションWCF:MaxReceivedMessageSizeクォータを設定する方法

を実行すると、受信メッセージ(65536)の最大メッセージサイズのクォータが を超えている、次のメッセージが表示されます。クォータを増やすには、適切なバインディング要素のMaxReceivedMessageSize プロパティを使用します。

また、クライアントとサーバープロジェクトの関連設定でMaxReceivedMessageSizeプロパティを追加しました。

クライアントアプリケーションでの私の設定です:WCFプロジェクトで

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="RPBasicHttpBinding" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000"> 
      <readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://localhost:40003/PersonWcfService.svc/PersonServices" 
     binding="basicHttpBinding" 
     contract="RP.Common.ServiceContract.IPersonService" name="BasicHttpBinding_IPersonService"> 
     <identity> 
      <dns value="localhost" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 

私の設定は次のとおりです。

<system.serviceModel> 
    <services> 
     <service name="RP.WcfService.PersonWcfService" behaviorConfiguration="RP.WcfServiceBehaviour"> 
     <endpoint address="PersonServices" binding="basicHttpBinding" bindingConfiguration="RPBasicHttpEndpointBinding" contract="RP.Common.ServiceContract.IPersonService" /> 
     </service> 
    </services> 
    <behaviors> 
    <serviceBehaviors> 
     <behavior name="RP.WcfServiceBehaviour"> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
    </serviceBehaviors> 
    </behaviors> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="RPBasicHttpEndpointBinding" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000"> 
      <readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    </system.serviceModel> 

他は、私はメッセージサイズクォータを増やすことMaxReceivedMessageSizeプロパティを設定する必要がある場合は?

答えて

2

クライアント側のエンドポイント構成にbindingConfiguration="RPBasicHttpBinding"がないので、指定された構成ではなくbasicHttpBindingのデフォルト構成が得られますか?

+0

+1おそらく問題が表示されませんでした –

+0

+1ありがとうございました!私の解決した問題は、エンドポイントの設定で 'bindingConfiguration =" RCISPBasicHttpBinding "を追加しました。 – Ehsan

1

サーバとコンシューマの設定を変更したら、それらのプロセスを再起動してください(サービスの再起動、アプリケーションプールの再起動など)。

また、localhostで実行しないことをお勧めします。 Localhostは多くの設定をバイパスし、問題解決を困難にする可能性があります。

関連する問題