2011-10-18 8 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는 많은 설정을 우회하여 문제 해결을 어렵게 만들 수 있습니다.

관련 문제