异常记录:

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. Jetson TX1 安装Kinect驱动

    1.添加Universe源 $ sudo apt-add-repository universe $ sudo apt-get update 2.安装编译工具和依赖项 $ sudo apt-get i ...

  2. 对于Json的认识

    Json简介 1. JSON 是什么 JSON,全称是 JavaScript Object Notation,即 JavaScript 对象标记法.   JSON 是一种轻量级(Light-Weigh ...

  3. 記一次undo問題

    記一次undo問題 參考:http://www.linuxidc.com/Linux/2014-06/103780.htm ORA-00376: 無法於此時讀取檔案 3 ORA-01110: 資料檔 ...

  4. C#匿名函数与Lambda表达式

    Lambda 表达式是一种可用于创建委托或表达式目录树类型的匿名函数. 通过使用 lambda 表达式,可以写入可作为参数传递或作为函数调用值返回的本地函数.在C#中的Linq中的大部分就是由扩展方法 ...

  5. socket相关系统调用的调用流程

    最近一直在读内核网络协议栈源码,这里以ipv4/tcp为例对socket相关系统调用的流程做一个简要整理,这些相关系统调用的内部细节虽然各有不同,但其调用流程则基本一致: 调用流程: (1)系统调用 ...

  6. aarch64_c1

    CBFlib-0.9.5.15-3.fc26.aarch64.rpm 2017-02-06 06:55 393K fedora Mirroring Project CBFlib-devel-0.9.5 ...

  7. Docker基础速成(一)

    Docker基础速成(一) 给亲爱的写的docker基础速成,按照步骤操作,实践出真知,希望有提纲挈领之功效 1.docker简介 Docker 轻量级容器,如图,类似于一个个集装箱,把复杂或者零散的 ...

  8. TreeCollection2

    Tree Collection 2 Table of Contents Introduction Structure Interfaces Data Node structure Tree struc ...

  9. volatile 学习笔记

    全面理解Java内存模型(JMM)及volatile关键字 正确使用 Volatile 变量 Java内存模型 在并发编程中,需要处理两个关键问题:线程之间如何通信及线程之间如何同步.通信是指线程之间 ...

  10. redis主从,哨兵(windows版)

    一.下载 由于redis官方并不支持windows操作系统,所以官网上是下不到的,需要到gitlab上下载,下载地址如下: https://github.com/MicrosoftArchive/re ...