Note that there are some explanatory texts on larger screens.

plurals
  1. POCall a WCF Service from a SQL CLR procedure in C#
    primarykey
    data
    text
    <p>I'm trying to call a WCF Service from a SQL Stored Procedure written in C#.</p> <p>I saw various posts or questions on about the same topic : <a href="https://stackoverflow.com/questions/3502343/calling-a-wcf-service-from-sql-clr-stored-procedure">Calling a WCF Service from SQL CLR Stored Procedure</a> <a href="https://stackoverflow.com/questions/751500/sql-clr-stored-procedure-and-web-service">SQL CLR Stored Procedure and Web Service</a></p> <p>But there's something I don't get. To be able to call my WCF Service from the Stored Procedure I'm creating the WCF client in the C# code of the procedure:</p> <pre><code> //Create an endpoint addresss for our service public static EndpointAddress endpoint = new EndpointAddress(new Uri("http://localhost:32226/ServiceName.svc")); //Create a binding method for our service public static WSHttpBinding HttpBinding = new WSHttpBinding(); //Create an instance of the service proxy public static ChannelFactory&lt;IServiceName&gt; MyChannelFactory = new ChannelFactory&lt;IRecursosHumanos&gt;(HttpBinding, endpoint); // Create a channel. public static IRecursosHumanos ServicioRrhh = MyChannelFactory.CreateChannel(); </code></pre> <p>I'm compiling the project as a .NET 3.0+ to be able to compile it (Reference to Sytem.ServiceModel). When I try to deploy it on the SQL Server, I'm getting the following message:</p> <pre><code>Msg 10301, Level 16, State 1, Line 2 Assembly 'MyAssembly' references assembly 'system.runtime.serialization, version=3.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(failed to retrieve text for this error. Reason: 15105)). Please load the referenced assembly into the current database and retry your request. </code></pre> <p>Should I register this assembly also on the server? as the assemblies needed for WCF? Wouldn't I damage the server adding so many assemblies?</p> <p>Thanks for your help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload