研究了一下HTTP 1.1的規格書,這個錯誤出現於當server(或proxy server)無法辨識client送出的Expect標頭
解決方法可以在Web.config的<configuration>區段中加入以下設定
<system.net> <settings> <servicePointManager expect100Continue="false" /> </settings> </system.net>或於呼叫Web Service前加入以下程式碼
System.Net.ServicePointManager.Expect100Continue = false;
參考
http://tools.ietf.org/html/rfc2616#section-10.4.18
http://tools.ietf.org/html/rfc2616#section-14.20
http://www.cnblogs.com/yukaizhao/archive/2009/07/15/httpwebrequest_return_417_expectation_failed.html
http://social.msdn.microsoft.com/Forums/en-US/devdocs/thread/60cd6e6a-4157-4811-8ed3-1e46f9022ea8
No comments:
Post a Comment