CLR SP with Web Service

  • Hi All,

    I create a web service that is consumed in a CLR SP.

    My web service get the data from X server and is hosted in web server.

    And create a VS database project to create a CLR stored procedure this CLR stored procedure consume web service.

    So Now I can deploy my VS database project on any daatabase by changing the connection string.

    Now My project is depoying on any connection string. So every thing is ok till now.

    Both assembly(simple and serilized) are exist where ever i deploy my VS project.

    But when I execute CLR SP in local it execute fine but If I change connection string to any server then it trow the below error.

    Msg 6522, Level 16, State 1, Procedure USP_iYogiPopUp, Line 0

    A .NET Framework error occurred during execution of user-defined routine or aggregate "USP_iYogiPopUp":

    System.InvalidOperationException: Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer. Please see inner exception for more information. ---> System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.

    System.IO.FileLoadException:

    at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)

    at System.Reflection.Assembly.Load(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence securityEvidence)

    at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)

    at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)

    at Microsoft.CSharp.CSharpCodeGener

    ...

    System.InvalidOperationException:

    at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)

    at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)

    at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)

    at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)

    at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)

    at System.Web.Services.Protocols.SoapClientType..ctor(Type type)

    at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()

    at iYogiPopUp_CLRUSP.iYogiPopUpWebServiceRefrence.iYogiPopUp..ctor()

    Please suggest.

    Thanks in advance.

    KD

  • i'm just throwing a guess out here, but I don't think you should be building a connection string...

    in all my CLR,s when I declare a SQL connection, i do it like this:

    Dim MyConnection As New SqlConnection("context connection=true")

    that means i will be piggy backing off of the implicit connection the end user already used to connect to the server...i don't need any information about the connection inside my proc, so i can concetrate on doing whatever the proc needs to do,a dn return back whatever i need to at the end..

    what are you doing that is different than that?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply