大马资讯论坛 - 马来西亚中文资讯平台

 找回密码
 注册
搜索
打印 上一主题 下一主题

C# WCF Error (413) Request Entity Too Large - Resolved

[复制链接]
跳转到指定楼层
1#
发表于 2013-3-13 22:05:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
错误:Web Service: System.Net.WebException: The remote server returned an error: (413) Request Entity Too Large.

你需要add maxBufferSize 和 maxReceivedMessageSize 在你的web.config里面,记得endpoint的binding也需要填写。

Please add maxBufferSize and maxReceivedMessageSize in your web.config and remember put binding in your endpoint.
  1.   <system.serviceModel>
  2.     <services>
  3.       <service name="Svc.login" behaviorConfiguration="ServiceBehaviorStandard">
  4.         <endpoint address="" binding="webHttpBinding" contract="Svc.Ilogin" behaviorConfiguration="web"/>
  5.       </service>
  6.     </services>

  7.     <bindings>
  8.       <webHttpBinding>
  9.         <binding maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
  10.       </webHttpBinding>
  11.     </bindings>   
  12.    
  13.     <behaviors>
  14.       <endpointBehaviors>
  15.         <behavior name="web">
  16.           <webHttp />
  17.         </behavior>
  18.       </endpointBehaviors>
  19.       <serviceBehaviors>
  20.         <behavior name="ServiceBehaviorStandard">
  21.           <serviceMetadata httpGetEnabled="true" />
  22.           <serviceDebug includeExceptionDetailInFaults="false" />
  23.         </behavior>
  24.       </serviceBehaviors>
  25.     </behaviors>
  26.     <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
  27.   </system.serviceModel>

  28.   <system.webServer>
  29.     <modules runAllManagedModulesForAllRequests="true"/>
  30.   </system.webServer>
复制代码

手机版|大马资讯论坛  

GMT+8, 2024-12-1 14:49 , Processed in 0.221360 second(s), 9 queries , File On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表