异常记录:

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服务的方式部署的,具体问题有待深入分析。

最新文章

  1. Xamarin.Android-用ZXing实现二维码扫描以及连续扫描
  2. Git从码云Clone代码到本地
  3. QQ五笔词库转拼音词库小工具
  4. 转载《android:scaleType属性》
  5. 操作系统中前台进程与后台进程(适用于Linux)
  6. win 10 远程连接出现 &quot;由于安全设置错误, 客户端无法连接到远程计算机. 确定你已登录到网络后.” 错误
  7. FragmentTabHost+ViewPager实现底部按钮
  8. pm2 开机自动运行
  9. jquery加入收藏代码
  10. You don&#39;t seem to have &#39;make&#39; or &#39;gmake&#39; in your PATH
  11. 通过HttpClient来调用Web Api接口,实体参数的传递
  12. libevent在windows下使用步骤详解
  13. 分布式定时任务框架——python定时任务框架APScheduler扩展
  14. 学习Spring必须了解的基础知识——回调机制
  15. 菜刀(代码执行)函数和命令执行函数详解及Getshell方法
  16. IDEA 如何查看一个类里面的所有方法
  17. Python基础之模块以及5大模块的使用
  18. Java 配置环境变量教程
  19. PHP字符串替换函数
  20. MyBatis之Collection

热门文章

  1. jQuery-选择器-查找标签
  2. 忘记SVN密码怎么办
  3. invalid byte sequence for encoding &quot;UTF8&quot;: 0xe99d2c
  4. ZooKeeper常见问题
  5. 如何在VS2013创建WebService并在IIS中发布
  6. 首次加载进来DEV控件列表第一行颜色总是不对,后台代码显示的数据正确
  7. JS正则表达式方法
  8. java正则表达式(转)
  9. 【考古向翻译】Pwn2Own 2010 Windows 7 Internet Explorer 8 exploit
  10. 树莓派3B更换源为阿里源