Wcf bindingConfiguration未被正确读取

Wcf bindingConfiguration未被正确读取,wcf,binding,web-config,wcf-binding,Wcf,Binding,Web Config,Wcf Binding,我有一个返回大量数据的WCF服务。所以我需要增加maxBufferSize和maxReceivedMessageSize。我的端点和绑定看起来是这样的: <endpoint address="" binding="basicHttpBinding" bindingConfiguration="ExtendedBinding" contract="NAThriveExtensions.INableAPI" /> <bindings>

我有一个返回大量数据的WCF服务。所以我需要增加maxBufferSize和maxReceivedMessageSize。我的端点和绑定看起来是这样的:

<endpoint 
    address=""
    binding="basicHttpBinding"
    bindingConfiguration="ExtendedBinding"
    contract="NAThriveExtensions.INableAPI"
/>

<bindings>
  <basicHttpBinding>
    <binding
       name="ExtendedBinding"
       maxBufferSize="655360"
       maxReceivedMessageSize="655360" >
    </binding>
  </basicHttpBinding>
</bindings>

据我所知,以上配置是正确的。当我通过WCFTestClient访问我的webseries时(服务托管在VS或IIS中),我检查配置并

1) 客户端部分中没有我的bindingConfiguration的名称

<client>
    <endpoint
       address="http://wikittybam/NAThriveExtensions/NableAPI.svc"
       binding="basicHttpBinding" 
       bindingConfiguration="BasicHttpBinding_INableAPI"
       contract="INableAPI" name="BasicHttpBinding_INableAPI" />
</client>

2) 被吸入客户端的绑定没有更新的maxZBufferSize或maxReceivedMessageSize,传输和消息安全存根不知何故被拉拢

<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_INableAPI" closeTimeout="00:01:00"
       openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
       allowCookies="false" bypassProxyOnLocal="false"      
       hostNameComparisonMode="StrongWildcard"
       maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
       messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
       useDefaultWebProxy="true">
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
         maxBytesPerRead="4096" maxNameTableCharCount="16384" />
         <security mode="None">
           <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
           <message clientCredentialType="UserName" algorithmSuite="Default" />
         </security>
    </binding>
  </basicHttpBinding>
</bindings>

我知道bindingConfiguration可以工作,因为我能够通过WCFTestClient测试传输安全性。如有任何见解,将不胜感激


谢谢

据我所知,绑定参数的细节没有在发布的元数据中公开。使用VS/Svcutil生成的服务代理包含所有这些内容的唯一原因是,它们非常愚蠢,使用所有值序列化绑定配置,即使它们都包含标准的默认值


现在,您必须手动调整客户端配置。

并非所有绑定参数都会被传输。Morover消息大小配置是针对拒绝服务攻击的防御,因此每个服务和客户端都可以有自己的配置,如果每次重新生成代理时都覆盖此配置,则情况将不好。它被称为maxReceiveMessageSize,因此它只检查输入消息的大小。您必须将此参数设置为接收端消息的预期大小。例如,如果您只计划从服务下载大型数据集,则不需要在该服务端配置高值,因为它不会接收此数据集,而是会发送它。在客户端,您必须设置此参数,否则消息将不会被处理

谢谢。使用我的WCF服务的应用程序不是基于.Net的,当我使用该应用程序中的服务时,一切正常。从测试的角度来看很糟糕,但很高兴它能起作用。