Sql CLR calling webservice throws exception
Posted
by
TonyP
on Stack Overflow
See other posts from Stack Overflow
or by TonyP
Published on 2011-01-09T12:30:42Z
Indexed on
2011/01/09
12:53 UTC
Read the original article
Hit count: 255
I have clr stored procedure that calls a Webservice method. Webmethod in turn call a com object .. and do some processing on a remote Unix server. When I invoke webmethod by it self it works fine. But when called from the CLR I get the following exception.. What am I doing wrong ?
Msg 6522, Level 16, State 1, Procedure PrintOa, Line 0
A .NET Framework error occurred during execution of user-defined routine or aggregate "PrintOa":
System.Security.HostProtectionException: Attempted to perform an operation that was forbidden by the CLR host.
The protected resources (only available with full trust) were: All
The demanded resources were: Synchronization
System.Security.HostProtectionException:
at System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData)
at System.Diagnostics.TypedElement.BaseGetRuntimeObject()
at System.Diagnostics.ListenerElement.GetRuntimeObject()
at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()
at System.Diagnostics.TraceInternal.get_Listeners()
at System.Diagnostics.TraceInternal.WriteLine(Object value)
at System.Diagnostics.Debug.WriteLine(Object value)
at BaaNOA.PrintOA(String trid)
© Stack Overflow or respective owner