Problem
Many times when you try to access REST / SOAP API it works fine from a browser but fails with SSIS PowerPack Components such as JSON Source or XML Source. You may see the following error.
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF'
Possible Cause
The server was expecting Headers in certain way based on some standard rules and it was not supplied. Web.config has UseUnsafeHeaderParsing property false by default.
Possible Solution
Try to send request with desired Headers and see it works. Best way to solve this try to capture web requests in Fiddler for Working vs Non-Working Call and find the difference.
As you see in below requests... top request was without desired headers and bottom request was from browser which sends correct headers. We compared both requests and found few headers missing in non-working request. Mostly Accept Header is what cause such issue. So try to add as below header in your failing call and try again.
Accept: text/html, application/xhtml+xml, */*
Another solution is edit server side web config or contact web admin to handle this for you so you do not get such error. See below link.
Contact Us
If you have more question(s) feel free to contact us via Live chat or email to support@zappysys.com
Comments
0 comments
Please sign in to leave a comment.