Visual Studio中的服务配置不起作用

时间:2014-12-05 15:42:18

标签: c# wcf maxreceivedmessagesize

我正在实现一个WCF服务,该服务应该提供比默认配置更大的数据集,并且我得到了异常

  

已超出传入邮件的最大邮件大小限额(65536)。要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性。

我已经搜索了很多,并尝试了web.config文件中的绑定配置,但似乎没有任何效果。

我希望你们中的一个能够找出我的错误,我想这很容易。

这是我的web.config

<system.serviceModel>
   <services>
      <service name="PgSynthDBService.SynthDBService">
         <endpoint 
             address="" 
             binding="wsHttpBinding" bindingConfiguration="MyBinding" 
             contract="PgSynthDBService.ISynthDBService" />
      </service>
   </services>
   <bindings>
      <wsHttpBinding>
         <binding name="MyBinding" 
                  maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
             <readerQuotas maxDepth="32" maxStringContentLength="2147483647"   
                           maxArrayLength="16348" maxBytesPerRead="4096" 
                           maxNameTableCharCount="16384" />          
         </binding>
      </wsHttpBinding>
   </bindings>
   <behaviors>
       <serviceBehaviors>
          <behavior>
             <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
             <serviceDebug includeExceptionDetailInFaults="false"/>
          </behavior>
       </serviceBehaviors>
   </behaviors>
   <protocolMapping>
      <add binding="basicHttpBinding" scheme="http" />
   </protocolMapping>
   <serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
                              multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
   <modules runAllManagedModulesForAllRequests="true"/>
   <directoryBrowse enabled="true"/>
</system.webServer>

提前致谢

0 个答案:

没有答案
相关问题