[转]C# post数据时 出现如下错误: System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed 的解决办法
2009-10-16 10:02
971 查看
.net(客户端)调用php(服务端)出现417错误
问题描述:
服务端环境:
linux + apache(lighttpd) + php5
客户端环境:
windowsxp + iis + .net
调用时出现如下错误:
System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed。 在 System.Net.HttpWebRequest.GetResponse() 在 org.phprpc.PHPRPC_Client.POST(String requestString) 在 org.phprpc.PHPRPC_Client.Invoke(String function, Object[] args, Boolean byRef, Byte encryptMode)
为人检出错误:
将服务写在windows的机器上错误就没有了
经过牛人”神童哥“的指点:
写.net程序时在始化代码中,或者配置文件app.config之类的文件中
加下这么一句就可以了
ServicePointManager.Expect100Continue = false;
效果不错,问题解决
归纳其原因:
httpwebrequest控件有一个透明过程,先向服务方查询url是否存在而不发送POST的内容,服务器如果证实url是可访问的,才发送POST,早期的Apache就认为这是一种错误,而IIS却可以正确应答 (神童哥)
问题描述:
服务端环境:
linux + apache(lighttpd) + php5
客户端环境:
windowsxp + iis + .net
调用时出现如下错误:
System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed。 在 System.Net.HttpWebRequest.GetResponse() 在 org.phprpc.PHPRPC_Client.POST(String requestString) 在 org.phprpc.PHPRPC_Client.Invoke(String function, Object[] args, Boolean byRef, Byte encryptMode)
为人检出错误:
将服务写在windows的机器上错误就没有了
经过牛人”神童哥“的指点:
写.net程序时在始化代码中,或者配置文件app.config之类的文件中
加下这么一句就可以了
ServicePointManager.Expect100Continue = false;
效果不错,问题解决
归纳其原因:
httpwebrequest控件有一个透明过程,先向服务方查询url是否存在而不发送POST的内容,服务器如果证实url是可访问的,才发送POST,早期的Apache就认为这是一种错误,而IIS却可以正确应答 (神童哥)
相关文章推荐
- C# post数据时 出现如下错误: System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed 的解决办法
- C# 模拟post数据提交时 出现如下错误: System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed 的解决办法
- C# post数据时 出现如下错误: System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed 的解决办法
- C# post数据时 出现如下错误: System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed 的解决办法
- C# post数据时 出现如下错误: System.Net.WebException: 操作超时
- C# post数据时 出现如下错误: System.Net.WebException: 操作超时
- C# post数据时 出现如下错误: System.Net.WebException: 操作超时
- C# post数据时 出现(417) Expectation Failed 的解决办法
- paip.远程服务器返回错误 (417) Expectation Failed 的解决办法
- 远程服务器返回错误: (417) Expectation Failed 的解决办法
- 远程服务器返回错误 (417) Expectation failed的解决方法
- 远程服务器返回错误:(417) Expectation failed 的解决方法
- C# 提交网页请求时出现如下错误: System.Net.WebException: 操作超时
- C# post数据时 一段时间后发生错误: System.Net.WebException: 操作超时
- System.Net.WebException: 请求因 HTTP 状态 417 失败: Expectation failed 问题
- “System.ServiceModel.DomainServices.Client.DomainOperationException:查询"XXX"load操作失败,远程服务器返回了错误:NoFound.……”解决方法
- asp.net 发送 xml post请求和接收 xml post请求时出现(500) 内部服务器错误的解决办法
- 在使用updatepanel 时,上传到服务器出现如下错误: Sys.WebForms.PageRequestManagerServerErrorException: 在服务器上处理请求时出现未知错误。服务器返回的状态码为: 500
- Asp.net错误“System.Web.HttpException: 超过了最大请求长度”解决办法
- Sys.WebForms.PageRequestManagerServerErrorException: 在服务器上处理请求时出现未知错误解决办法