WCF MaxReceivedMessageSize属性没有
搜索没有运气......
我一直在
已超出传入邮件的最大邮件大小限额(65536)。要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性。
这很有意义,所以我进入服务器和客户端配置并进行更改:
客户
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IFileUpload"
closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transferMode="Streamed" messageEncoding="Text" maxBufferSize="65536" maxReceivedMessageSize="67108864">
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/services/FileUpload.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFileUpload"
contract="CFTW.FileUpload.IFileUpload" name="BasicHttpBinding_IFileUpload" />
</client>
</system.serviceModel>
服务器
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IFileUpload"
transferMode="Streamed" messageEncoding="Text" maxBufferSize="67108864" maxBufferPoolSize="67108864" maxReceivedMessageSize="67108864">
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="BasicHttpBinding_IFileUpload">
<endpoint address="~/services/FileUpload.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFileUpload"
contract="CFTW.FileUpload.IFileUpload"></endpoint>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
我不确定为什么它不起作用(否则我会解决它:))。它运行在.NET 4.0 RC上。
没有找到相关结果
已邀请:
3 个回复
骚瓤
。然后一切都开始使用新设置。这是因为.NET 4.0带有默认的绑定/端点/行为配置。这些默认设置为
。我刚修改了默认绑定本身。我的自定义绑定(命名)未应用的原因是由于
标记中的名称值。它应该遵循
。
森含械
。另外,请务必为
设置相同的值。对于缓冲连接,这两个值必须相同。
唤副埂侧壬