Last post Mar 21, 2013 03:29 AM by Steven Cheng - MSFT
Mar 18, 2013 09:20 PM|AndyW2009|LINK
I have an existing WCF service that is using serialization (attribute on the class). I can't change this service as it is used by a few applications.
I have a SQL Server  CLR table valued function that I can call within SQL server successfully. I need to modify this function so that it makes a call to the WCF Service.
However, when using SVCUtil to generate the proxy it is adding serialization code to the proxy (I am not using the /s command when calling SVCUtil). The generated datacontract is being tagged with a [System.SerializableAttribute()] and is inheriting from
The issue is that I am getting an error SQL72014 .Net SqlClient Data Provider: Msg 6503..... Assembly 'system.runtime.serialization..... not found in sql catalog.
Does anyone have any idea on how I can turn off the addition of the serialization code as I don't believe it is allowable in SQL CLR.
Mar 21, 2013 03:29 AM|Steven Cheng - MSFT|LINK
The SQL CLR by default only supports limited .NET Framework library classes. In case we want to add code logic in CLR SP or function which relies on some .NET assemblies/classes out side of the default supported set, we will need to register the certain
assemblies for the target database. And the system.runtime.serialization assemblies will be needed when you try using WCF client in SQL CLR. Here are some web references and threads talking about using WCF from SQL CLR, you can have a look at them and try
importing the necessary assemblies. Be careful about the framework version and 64, 32bit difference when you choose to import a certain assembly):
#WCF from CLR Functions
#Deploying WCF Client assembly in SQL2005
#SQL 2008 CLR calling WCF