搜索没有运气...
我不断得到
已超出传入邮件 (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 上运行。