作者fumizuki (蒙面加菲狮)
看板Visual_Basic
标题[.NET] 417 Expectation Failed
时间Sat May 4 13:53:05 2013
状况:
呼叫 Web Service 出现 HTTP 状态 417 Expectation Failed
原因:
Server 收到无法识别的标头(不太了解其中原因)
解决方案1:
浏览器的 proxy 设定关闭
解决方案2:
浏览器的 proxy 设定中的例外,输入 Web Service 的伺服器位址或网域名称
解决方案3:
在 Web.config 的 <configuration> 区段中加入以下设定
<system.net>
<settings>
<servicePointManager expect100Continue="false" />
</settings>
</system.net>
解决方案4:
呼叫 Web Service 前加入以下程式码:
System.Net.ServicePointManager.Expect100Continue = false
参考资料:
http://dev.pete.tw/2010/10/get-http417-when-calling-web-service.html
备注:实测解决方案3 无效,4未实测,1或2才解决问题
--
▃▅▇▆▄ ▆▂▃ `
逝去感情如何能留住,半点痴情遗留殊不易,██▅▇▄▃ ▇▃▂" .
█████████▃i ▁▄▇
更多凄凄惨惨的遭遇…………██▆▃ █▅▆▃ˍ▄*
◢ ▂█▄▇▅▂▌.
我不知道,王~八~蛋~~! ▂▆███ █▄▃ 。fumizuki。Check。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.194.229.179