我们如何在WCF服务端定义最大缓冲区大小的绑定,而不是在客户端。有没有人能告诉我这是否可行?我不想在客户端定制绑定。
发布于 2014-02-11 13:52:53
这可能会对你有帮助!在Web.Config中添加maxRequestLength=214748364。
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="300"/>
</system.web>如果它不起作用,在标签中添加这个。
<bindings>
<webHttpBinding>
<binding name="webHttpBG" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"
maxBufferPoolSize="21474836470" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00">
<security mode="None"/>
</binding>
</webHttpBinding>
</bindings>在你的标签里。做这样的事情。
<services>
<service behaviorConfiguration="" name="Your.Service.Name">
<endpoint address="" behaviorConfiguration="RESTBehavior" binding="webHttpBinding"
bindingConfiguration="webHttpBG" contract="Your.Package.IContract" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:51855/Contract.svc" />
</baseAddresses>
</host>
</service>https://stackoverflow.com/questions/21694038
复制相似问题