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!

[609 byte] By [wyx2000] at [2008-2-25]
# 1
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.

VineetRao-Microsoft at 2007-9-9 > top of Msdn Tech,SQL Server,.NET Framework inside SQL Server...
# 2

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.

VineetRao-Microsoft at 2007-9-9 > top of Msdn Tech,SQL Server,.NET Framework inside SQL Server...

SQL Server

Site Classified