我已经设置了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/