异常记录:

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 的提问:

https://stackoverflow.com/questions/2482715/the-server-committed-a-protocol-violation-section-responsestatusline-error

过了一会儿客户端有一切正常了,这个问题我还搞不明白。

我的服务是部署在Azure云,采用paas服务的方式部署的,具体问题有待深入分析。

异常:The server committed a protocol violation的更多相关文章

  1. 服務器提交協議衝突 (The server committed a protocol violation.)

    ---解決方法 (放在 app.config / web.config)--- <system.net> <settings> <httpWebRequest useUn ...

  2. FtpWebRequest UploadFile返回"The underlying connection was closed: The server committed a protocol violation."解决方法

    将FtpWebRequest的KeepAlive设置为true. return Return<Boolean>( new Uri(ftpPath + fileName), request ...

  3. The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF

    打开表单偶尔会出现这个提示,解决方法: web.config增加配置: <configuration> <system.net> <settings> <ht ...

  4. 异常:java.lang.LinkageError: loader constraint violation: when resolving interface method

    异常:java.lang.LinkageError: loader constraint violation: when resolving interface method "javax. ...

  5. 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 ...

  6. 异常: 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. ...

  7. 解决sqoop导入报错:Caused by: java.sql.SQLException: Protocol violation

    报错信息: -- ::, INFO [main] org.apache.hadoop.mapred.MapTask: Ignoring exception during close for org.a ...

  8. 服务信息块协议 SMB(Server Message Block protocol)

    SMB(Server Message Block)是协议名,它能被用于Web连接和客户端与服务器之间的信息沟通. SMB协议 SMB最初是IBM的贝瑞·费根鲍姆(Barry Feigenbaum)研制 ...

  9. zabbix3.0安装之图形界面显示异常【server】

    前面记录过Zabbix3.0的安装过程,遇到一些坑,当时就在博文最后提到过,显示界面只有文字没有样式的问题.今天就解决这个小问题. 首先, 我们的安装是基于nginx作为web服务器的,不是传统的用A ...

随机推荐

  1. 对web标准的理解,以及对w3c组织的认识

    (1)web标准规范要求,书写标签必须闭合.标签小写.不乱嵌套,可提高搜索机器人对网页内容的搜索几率.--- SEO(2)建议使用外链css和js脚本,从而达到结构与行为.结构与表现的分离,提高页面的 ...

  2. 事件,继承EventArgs带有参数的委托

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  3. .NET 4.5 Task异步编程学习资料

    参考资料: 1. http://www.cnblogs.com/heyuquan/archive/2013/04/18/3028044.html

  4. centos7的防火墙(firewalld)

    Centos7中默认将原来的防火墙iptables升级为了firewalld,firewalld跟iptables比起来至少有两大好处: 1.firewalld可以动态修改单条规则,而不需要像ipta ...

  5. Docker中安装wiki Confluence

    一下内容在centos 7安装成功. 一.安装docker 1.yum安装docker yum update # 更新yum yum install docker # yum安装docker 2.开启 ...

  6. python+selenium第一步 - 环境搭建

    刚开始学习一门技术,肯定是要从环境搭建开始的,我也不例外. 首先选择需要安装的版本,我使用的是mac自带的2.7版本. selenium2,和火狐浏览器 为求稳定不会出现未知问题,我选择了seleni ...

  7. 使用dos命令创建多模块Maven项目

    好吧,咱们接着上一篇博客继续用另一种方式来创建Maven项目.不过在创建之前我们应该先熟悉一些相关dos命令. 创建web项目命令: mvn archetype:generate -DgroupId= ...

  8. GreenPlum学习笔记:create table创建表

    二维表同样是GP中重要的存储数据对象,为了更好的支持数据仓库海量数据的访问,GP的表可以分成: 面向行存储的普通堆积表 面向列存储的AOT表(append only table) 当然AOT表也可以是 ...

  9. MySQL学习笔记:生成时间维度表2

    实现目的: 测试: # 测试 加一秒 SECOND), INTERVAL SECOND); SECOND),'%H%i%s');# 第一秒 SECOND),'%H%i%s');# 最后一秒 SELEC ...

  10. MySQL 连接本地数据库、远程数据库命令

    一.MySQL 连接本地数据库,用户名为“root”,密码“123”(注意:“-p”和“123” 之间不能有空格) C:/>mysql -h localhost -u root -p123 二. ...