tags:

views:

26

answers:

3

After moving application to shared hosting I cannot add service reference to .asmx and WCF services that used to work on dedicated server.

The error in adding WCF service reference is:

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 reference:

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

Any ideas?

A: 

It looks as though when you uploaded the files something (probably your ftp client) converted all the line endings to Unix style. Try to re-upload the files again making sure no file conversions happen.

Ashley
No. The content of the "web service files" would have nothing to do with the output generated by browsing to the file.
John Saunders
A: 

It looks like some piece of networking equipment or software is set to convert line endings to Unix style. Say that to the hoster's tech support people and they may immediately say, "oh, so you don't want Unix-mode turned on" or something to that effect.

John Saunders
A: 

One way to debug this (and to make sure it is the protocol violation that is causing the problem), is to use Fiddler (Http Web Proxy) and see if the same error occurs. If it doesn't (i.e. Fiddler handled the issue for you) then you should be able to fix it using the UseUnsafeHeaderParsing flag.

If you are looking for a way to set this value programatically see the examples here: http://o2platform.wordpress.com/2010/10/20/dealing-with-the-server-committed-a-protocol-violation-sectionresponsestatusline/

Dinis Cruz