CSLA支持大文件上传时web服务器端web.cong配置
解决CSLA4.0大文件上传时web服务器端web.cong配置,业务对象采用byte[]数组方式,
当业务对象占用的字节数太大时,需要配置WCF的接收配额,设置最大配额。
此Web.config只支持Silverlight客户端的调用,已经设置成最大,
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="basicHttpBinding_IWcfPortal" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"> <readerQuotas maxBytesPerRead="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647" maxNameTableCharCount="2147483647" maxDepth="2147483647"/> binding> basicHttpBinding> <wsHttpBinding> <binding name="wsHttpBinding_IWcfPortal" maxReceivedMessageSize="2147483647"> <readerQuotas maxBytesPerRead="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647" maxNameTableCharCount="2147483647" maxDepth="2147483647"/> binding> wsHttpBinding> bindings> <behaviors> <serviceBehaviors> <behavior name="WcfPortalBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> behavior> serviceBehaviors> behaviors> <services> <service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.Silverlight.WcfPortal" > <endpoint address="" binding="basicHttpBinding" contract="Csla.Server.Hosts.Silverlight.IWcfPortal" bindingConfiguration="basicHttpBinding_IWcfPortal"> <identity> <dns value="localhost"/> identity> endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> service> services> system.serviceModel>
silverlight端:
ServiceReferences.ClientConfig
<configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IWcfPortal" maxBufferSize="10000000" maxReceivedMessageSize="10000000" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00"> binding> basicHttpBinding> bindings> <client> <endpoint address="http://localhost:1431/WcfPortal.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfPortal" contract="WcfPortal.IWcfPortal" name="BasicHttpBinding_IWcfPortal" /> client> system.serviceModel> configuration>
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
