CLR WebService Access
-
I need to access a billing webservice from SQL. I createde a new c# class project and made a web refrence to the web service "ProdBilling". Here is the code of my assembly using System.Data; using Microsoft.SqlServer.Server; using System.Data.SqlTypes; namespace PaymentProc { public class PaymentProc { [Microsoft.SqlServer.Server.SqlProcedure] public static void ChargeCard(int account, int amount) { string Response; ProdBilling.Service serv = new ProdBilling.Service(); Response = serv.ChargeCard(account, amount); SqlContext.Pipe.Send(Response); } } } I then ran WSDL wsdl /o:PaymentProc.cs /n:PaymentProc http://ProdWeb1/PaymentProc/PaymentProc.asmx Then compliled csc /target:library PaymentProc.cs and added the assembly CREATE ASSEMBLY PaymentProc from 'D:\ProdCode\PaymentProc.dll' WITH PERMISSION_SET = UNSAFE I cannot figure out how to refrence the chargecard method I have tried CREATE PROCEDURE PaymentProc @Account int, @Amount int AS EXTERNAL NAME PaymentProc.[PaymentProc.PaymentProc].ChargeCard It seems wsdl.exe put all this serialization code namespace PaymentProc { using System.Diagnostics; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; using System.Xml.Serialization; /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="ServiceSoap", Namespace="http://ProdWeb1/PaymentProc")] public partial class PaymentProc : System.Web.Services.Protocols.SoapHttpClientProtocol { private System.Threading.SendOrPostCallback ChargeCardOperationCompleted; /// public PaymentProc() { this.Url = "http://ProdWeb1/PaymentProc/PaymentProc.asmx"; } /// public event ChargeCardCompletedEventHandler ChargeCardCompleted; /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://ProdWeb1/PaymentProc/ChargeCard", RequestNamespace="http://ProdWeb1/PaymentProc", ResponseNamespace="http://ProdWeb1/PaymentProc", Use=System.Web.Services.Description.SoapBinding