http protocol violation when webrequest in sqlfunction, thanks

when I use webrequest to call a url, I got

"The server committed a protocol violation", I found out this is because the url returns something 2.0 think is not standard, the solution is turn on useUnsafeHeaderParsing, so I add the below to my machine.config

<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = "true" />
</settings>
</system.net>


but after I add that, I got different error when I call the function :

The type initializer for 'System.Net.Configuration.SettingsSectionInternal' threw an exception.


Any idea

thanks!


Answer this question

http protocol violation when webrequest in sqlfunction, thanks

  • Rachenoba

    What is the exact exception you are getting It looks like you would need to register your assembly as unsafe for this to work.

    Thanks,
    -Vineet.

  • BobReed

    Which version of SQL Server / Visual Studio (.NET Framework) are you using. This should be working in Sept CTP. Could you please upgrade and try.

    Thanks,
    -Vineet.



  • http protocol violation when webrequest in sqlfunction, thanks