异常:The server committed a protocol violation
异常记录:
Exception rethrown at [0]:
在 Wintop.Windows.FrmLogin.btnLogin_Click(Object sender, EventArgs e)
2017-07-10 17:08:29.8774 ERROR 登陆出错 System.ServiceModel.CommunicationException: 服务器提交了协议冲突. Section=ResponseHeader Detail=“Content-Length”标题值无效 ---> System.Net.WebException: 服务器提交了协议冲突. Section=ResponseHeader Detail=“Content-Length”标题值无效
在 System.Net.HttpWebRequest.GetResponse()
在 System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- 内部异常堆栈跟踪的结尾 ---
Server stack trace:
在 System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
在 System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
在 System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
在 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
The server committed a protocol violation. Section=ResponseHeader Detail='Content-Length' header value is invalid
今天客户端偶然碰到了这个问题,从来没有发生过。
网上收集的资料来看,大部分的解决方案是在 web config文件 和 app config文件添加一个配置:
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
一个 Stack Overflow 的提问:
过了一会儿客户端有一切正常了,这个问题我还搞不明白。
我的服务是部署在Azure云,采用paas服务的方式部署的,具体问题有待深入分析。
异常:The server committed a protocol violation的更多相关文章
- 服務器提交協議衝突 (The server committed a protocol violation.)
---解決方法 (放在 app.config / web.config)--- <system.net> <settings> <httpWebRequest useUn ...
- FtpWebRequest UploadFile返回"The underlying connection was closed: The server committed a protocol violation."解决方法
将FtpWebRequest的KeepAlive设置为true. return Return<Boolean>( new Uri(ftpPath + fileName), request ...
- The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
打开表单偶尔会出现这个提示,解决方法: web.config增加配置: <configuration> <system.net> <settings> <ht ...
- 异常:java.lang.LinkageError: loader constraint violation: when resolving interface method
异常:java.lang.LinkageError: loader constraint violation: when resolving interface method "javax. ...
- Xlib: connection to ":0.0" refused by server Xlib: No protocol specified解决方案
Xlib: connection to ":0.0" refused by server Xlib: No protocol specified 解决办法: 1. 退出oracl ...
- 异常: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configurat
异常: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. ...
- 解决sqoop导入报错:Caused by: java.sql.SQLException: Protocol violation
报错信息: -- ::, INFO [main] org.apache.hadoop.mapred.MapTask: Ignoring exception during close for org.a ...
- 服务信息块协议 SMB(Server Message Block protocol)
SMB(Server Message Block)是协议名,它能被用于Web连接和客户端与服务器之间的信息沟通. SMB协议 SMB最初是IBM的贝瑞·费根鲍姆(Barry Feigenbaum)研制 ...
- zabbix3.0安装之图形界面显示异常【server】
前面记录过Zabbix3.0的安装过程,遇到一些坑,当时就在博文最后提到过,显示界面只有文字没有样式的问题.今天就解决这个小问题. 首先, 我们的安装是基于nginx作为web服务器的,不是传统的用A ...
随机推荐
- Count of Smaller Number before itself
Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 1 ...
- listen系统调用
/* * Perform a listen. Basically, we allow the protocol to do anything * necessary for a listen, and ...
- linux服务器登录时慢出现卡顿
使用SSH远程登录Linux在输入用户名之后在过了好几秒之后才会出现输入密码.严重影响工作效率.登录很慢,登录上去后速度正常,这种情况的主要原因为: DNS反向解析的问题 SSH在登录的时候一般我们输 ...
- getattr的使用
from requests_html import HTMLSession class UrlGenerator(object): def __init__(self, root_url): self ...
- codevs 1230 元素查找
题目链接:http://codevs.cn/problem/1230/ 题解: 会有很多方法写这道题,写个裸的哈希练练手 #include<cstdio> ,MOD=; int n,m,h ...
- mysql命令补全工具
需要在linux中下载mysql插件. 安装mysql插件 yum -y install epel-release python-pip python-devel pip install mycli ...
- es6遍历数组forof
- 监控SQLServer作业执行情况脚本
SELECT [sJOB].[job_id] AS [作业ID] , [sJOB].[name] AS [作业名] , CASE WHEN [sJOBH].[run_date] IS NULL OR ...
- Python学习笔记:startswith & endswith 判断开头结尾是否为指定字符串
作用: 判断字符串是否以指定字符或子字符串结尾,常用于判断文件类型. 如果以指定后缀结尾返回True,否则返回False. 可选参数"start"与"end"为 ...
- CVE-2013-0025
Microsoft IE ‘SLayoutRun’释放后重用漏洞(CNNVD-201302-197) Microsoft Internet Explorer是微软Windows操作系统中默认捆绑的WE ...