2010-08-19 51 views
1

将应用程序移至共享主机后,我无法将服务引用添加到曾用于专用服务器上的.asmx和WCF服务。添加服务引用时出错服务器提交了违反协议

中添加WCF服务引用的错误是:

There was an error downloading 'address ... Service.svc'. 
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF 
Metadata contains a reference that cannot be resolved: 'address ... Service.svc'. 
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF 
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF 
If the service is defined in the current solution, try building the solution and adding the service reference again. 

ASMX Web引用:

There was an error downloading 'address ... .asmx'. 
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF 
There was an error downloading 'address ... .asmx/$metadata'. 
The server committed a 

任何想法?

回答

1

它看起来好像你上传文件的东西(可能是你的ftp客户端)将所有行结束符转换为Unix样式。尝试重新上传文件,确保没有文件转换发生。

+0

号“web服务文件”的内容就什么都没有做与通过浏览到文件生成的输出。 – 2010-08-19 19:48:08

1

它看起来像一些网络设备或软件设置为将行结束符转换为Unix样式。对于托管服务提供商的技术支持人员,他们可能会立即说,“哦,所以您不希望Unix模式开启”,或者出现这种情况。

2

调试此方法(并确保导致问题的协议违规)的一种方法是使用Fiddler(Http Web Proxy)并查看是否发生相同的错误。如果没有(即Fiddler为你处理这个问题),那么你应该可以使用UseUnsafeHeaderParsing标志来修复它。

如果你正在寻找一种方法来设置这个值编程在这里看到的例子:http://o2platform.wordpress.com/2010/10/20/dealing-with-the-server-committed-a-protocol-violation-sectionresponsestatusline/

相关问题