• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
27 views

Problem:

I am getting this error . I tried few things among which i also tried following configuration but no luck:

<system.net>

<settings>

<httpWebRequest useUnsafeHeaderParsing="true" />

</settings>

</system.net>

Error reads as :

Error description is the following:

                --- Inner Exception ---

                System.Net.WebException

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

                - Source: System

                - Stack trace:

                        at System.Net.HttpWebRequest.GetResponse()

                        at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

by (330 points)  

1 Answer

0 votes

Reasons for this error:

When accessing REST / SOAP API through browser it works fine .

Accessing same via SSIS PowerPack Components ie JSON Source or XML Source may fail.

So the reason is Headers was expected with values such as Accept, User-Agent but not supplied.

Solution:

Send request with your Headers to check if its working or not.

Capture request in fiddler for working and nt working call and see whats missing.

Try adding following in  header in your unsuccess calls and see:

Accept: text/html, application/xhtml+xml, */* 

Some links to read through:

http://www.iishacks.com/index.php/2009/11/11/remove-x-powered-by-aspnet-http-response-header/

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d758f32d-4ca4-49ed-aaaf-b0f89a82a907/the-server-committed-a-protocol-violation-sectionresponseheader-detailcr-must-be-followed-by-lf?forum=sqlreportingservices

by (1.4k points)  
...