wcf - 已超过传入消息的最大消息大小配额(65536)

标签 wcf wcf-data-services

我已经设置了app.config文件,因此maxRecievedMessageSize远远超过65536,我可以得到一些改进的建议吗?

这是我当前的app.config文件

<bindings>
  <basicHttpBinding>
    <binding
     name="FinalInspectionEndpoint"
     maxBufferSize="2147483647"
     maxReceivedMessageSize="2147483647" >
      <security mode="None" />
      <readerQuotas maxDepth="2000000" maxStringContentLength="2000000" maxArrayLength="2000000" maxBytesPerRead="2000000" maxNameTableCharCount="2000000" />
    </binding>
  </basicHttpBinding>
</bindings>


<services>
  <service name="AGY.FI.SQLService.FinalInspectionManager">
    <endpoint address="" binding="basicHttpBinding" contract="AGY.FI.SQLService.FinalInspectionService" bindingConfiguration="FinalInspectionEndpoint">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"  />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8732/Design_Time_Addresses/AGY.FI.SQLService/Service1/" />
      </baseAddresses>
    </host>
  </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="False" />
    </behavior>
  </serviceBehaviors>
</behaviors>

最佳答案

该配置文件看起来已正确设置。

您是否仍然遇到错误,或者只是问是否有更好的方法来做您正在做的事情?消息的大小是否可能大于您当前设置的值?

如果是前者,您看到的错误是什么?

如果是后者,我唯一推荐的方法是将maxReceivedMessageSize的大小设置为一个与您期望该服务所需的最大值一样大的值,这样就可以避免遭受DDOS攻击。

关于wcf - 已超过传入消息的最大消息大小配额(65536),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6628322/

相关文章:

c# - REST 不是标准的 'Per-Se' 那么为什么 WCF 创建一个 wsdl,有什么意义,它比 SOAP 更糟糕吗?

c# - 从 android 连接 wcf 服务时出错。错误: Failed to connect to/10. 0.2.2

c# - 如何成功地为工作站应用程序自行托管 ASP.NET MVC 应用程序或 OData 服务?

sql - WCF 服务中断对数据库的调用

c# - WinPhone WCF : ErrorObject parsing/EndInvoke() Error

wcf - 从 jQuery 调用启用 AJAX 的 WCF 服务

wcf - 如何配置 fiddler 来监控对 IISExpress 中托管的 wcf 服务的 wcf 调用

serialization - 使用 Azure 表存储的替代方法?

c# - 如何使用来自不同项目的模型类通过反射提供程序创建 WCF 数据服务 OData?

linq-to-sql - 使用带有解密层的 LINQ-to-SQL 的 oData/ADO.NET 数据服务