WCF配置:为所有绑定设置maxReceivedMessageSize?

时间:2013-01-09 18:31:15

标签: asp.net wcf web-services

目前我在每个绑定上设置 maxReceivedMessageSize ,有没有办法简单地一次性设置它?

  <wsHttpBinding>
    <binding name="WSHttpBinding_IQQQService" maxReceivedMessageSize="250000"  />
    <binding name="WSHttpBinding_ISSSService" maxReceivedMessageSize="250000"  />
    <binding name="WSHttpBinding_IDDDService" maxReceivedMessageSize="250000"  />
    <binding name="WSHttpBinding_IFFFService" maxReceivedMessageSize="250000"  />
  .....

1 个答案:

答案 0 :(得分:2)

如果您不提供名称,则应将其视为默认名称。

<wsHttpBinding>
  <binding maxReceivedMessageSize="250000">
</wsHttpBinding>

这适用于WCF4,可以找到更多信息here on msdn