Call web method from script task

  • Hello,

    I can't seem to find anywhere straight forward examples on how to call (invoke) a web method from script task.

    Here is what I have:

    1. Created scrip task

    2. Added web reference to my service. lets call it ABC_SERVICE

    3. Added

    using System.Xml;

    using System.Web.Services;

    using System.Web.Services.Description;

    using System.Web.Services.Discovery;

    4. Loaded my variables into script

    var enrollId= dts.variables["abc"].value

    var legacyId= dts.variables["def"].value

    5.

    NOW, how do I actually call to execute method of my service?

    my method name is

    UpdateMyId(Guid enrollId, int legacyId);

    I also know that i have to "In order to consume the Web Service in SSIS Script Task, first you need to create a Proxy Class by using WSDL".. but whenever i try to use wsdl.exe on my machine i get an error saying access denied to path where i have the wsdl.exe. Not sure what exactly is not allowing access since i am on this machine.

    Actually, why would i need to create a proxy class if i already addding web reference to script task?

    i am a bit lost.

    Thanks

  • Hi Juls-195136

    You may use an Script Task component to consume the Web Service, but you also have the Web Service Task, which is better; I found the following article at Code Project site, this is the link: Calling a Web Service from a SQL Integration Services package; It has a very well written procedure.

    The most difficult step in that procedure will be finding your web service WSDL file, you can get it directly from your web service, by opening it with Internet Explorer and clicking on the Service Description, the output from the link is the WSDL, copy and save it to a file that end with the type WSDL.

    Cheers,

    Hope this helps,
    Rock from VbCity

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

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