Por que meu serviço WCF não está carregando minha configuração de ligação?
Estou com o seguinte erro: "A cota máxima do tamanho das mensagens recebidas (65536) foi excedida. Para aumentar a cota, use a propriedade MaxReceivedMessageSize no elemento de ligação apropriado."
Então, fiz uma pesquisa e descobri que precisava aumentar o tamanho do buffer e da mensagem, eis o meu arquivo de configuração do Serviço WCF:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="default" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"/>
</wsHttpBinding>
</bindings>
<services>
<service name="WCF.Service.Service">
<endpoint address="ws" name="ws" bindingConfiguration="default" binding="wsHttpBinding" contract="WCF.Service.Contracts.IService" />
<endpoint address="mex" binding="mexHttpBinding" name="mex" contract="IMetadataExchange" />
</service>
</services>
<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>
</system.serviceModel>
Quando executo o serviço no WCF Test Client e olho para o arquivo de configuração do cliente gerado, elenão tem minha ligação:
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="ws" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:37444/Service.svc/ws" binding="wsHttpBinding"
bindingConfiguration="ws" contract="IService" name="ws">
<identity>
<userPrincipalName value="username@domain" />
</identity>
</endpoint>
</client>
</system.serviceModel>
Estou perdido porque a minha configuração de ligação éNÃO sendo aplicado !? O cliente de teste do WCF está definido para sempre gerar novamente a configuração também. Eu também tentei atualizar a referência de serviço em um aplicativo front-end consumidor, mas elenão obtenha a configuração de ligação atualizada também. Todas as sugestões serão muito apreciadas. Obrigado!