首页 新闻 会员 周边

wcf rest中老是提示出 request entity too large?

0
悬赏园豆:20 [待解决问题]

通过POST方式传递实体对象JSON数据。当内容大到一定长度,就会提示

---------------------------
错误提示
---------------------------
系统未捕获异常:远程服务器返回错误: (413) Request Entity Too Large。

您是否终止运行?

异常信息: 在 System.Net.HttpWebRequest.GetResponse()
在 XueDa.SSESClient.OAuth.Request(String url, RequestMethod method, Parameter[] parameters)

在Web.config文件中已经增加了如下节点,还是始终出现此错误,

<security>
<requestFiltering>
<requestLimits maxUrl="10999" maxQueryString="204800" maxAllowedContentLength="2097151000"/>
</requestFiltering>
</security>

 

<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime maxRequestLength="2097151" executionTimeout="3600" useFullyQualifiedRedirectUrl="true" />
</system.web>

具体是什么原因呢?

guyanlj的主页 guyanlj | 初学一级 | 园豆:184
提问于:2013-07-08 17:46
< >
分享
所有回答(2)
0

transferMode="Buffered"吗?

如果是,同时调大maxBufferesize

空葫芦 | 园豆:9 (初学一级) | 2013-07-08 17:48

<webHttpBinding>
<binding name="HttpJsonpBinding" transferMode="Buffered" crossDomainScriptAccessEnabled="true"></binding>
</webHttpBinding>

 

上面加了这种,也是不行的。还照样报这错。

支持(0) 反对(0) guyanlj | 园豆:184 (初学一级) | 2013-07-08 17:58

@guyanlj: 你用的JSONP请求?

支持(0) 反对(0) 空葫芦 | 园豆:9 (初学一级) | 2013-07-08 21:08
0
dudu | 园豆:31007 (高人七级) | 2013-07-08 18:00

还是不行?

支持(0) 反对(0) guyanlj | 园豆:184 (初学一级) | 2013-07-09 10:43

@guyanlj: 建议确认一下是请求内容过大还是响应内容过大

支持(0) 反对(0) dudu | 园豆:31007 (高人七级) | 2013-07-09 10:46

@dudu: 是请求内容过大

支持(0) 反对(0) guyanlj | 园豆:184 (初学一级) | 2013-07-09 11:07

@guyanlj: IIS版本是多少?

支持(0) 反对(0) dudu | 园豆:31007 (高人七级) | 2013-07-09 11:11

@dudu: IIS7.5

支持(0) 反对(0) guyanlj | 园豆:184 (初学一级) | 2013-07-09 11:34

@guyanlj: 试试在applicationHost.config中设置一下uploadReadAheadSize,操作命令示例如下:

appcmd.exe set config -section:system.webserver/serverruntime/uploadreadaheadsize: 1048576 /commit:apphost
支持(0) 反对(0) dudu | 园豆:31007 (高人七级) | 2013-07-09 11:39

@dudu: 

C:\Windows\System32\inetsrv>appcmd.exe set config -section:s
erruntime/uploadreadaheadsize: 1048576 /commit:apphost
ERROR ( message:找不到带有标识符“1048576”的 SITE 对象。 )

报这种错了

支持(0) 反对(0) guyanlj | 园豆:184 (初学一级) | 2013-07-09 12:39

@guyanlj: appcmd.exe set config  -section:system.webServer/serverRuntime /uploadReadAheadSize:"1048576"  /commit:apphost

支持(0) 反对(0) dudu | 园豆:31007 (高人七级) | 2013-07-09 12:43

@dudu: 还是报 

request entity too large 这个错误

支持(0) 反对(0) guyanlj | 园豆:184 (初学一级) | 2013-07-09 12:54

@guyanlj: 建议确认一下这个错误究竟是谁返回的

支持(0) 反对(0) dudu | 园豆:31007 (高人七级) | 2013-07-09 12:57
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册