Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. CLR WebService Access

CLR WebService Access

Scheduled Pinned Locked Moved Database
csharpdatabasedotnetwcfsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DerekFL
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups