Sunteți pe pagina 1din 10

How to call a Web Service by Using the Web Service Task in SSIS

In this post we are going to discuss about the how to configure Web Service task to call Currency Convertor Web Service SSIS and how to read the information from the web service Currency Convertor . in this example we used the public web service from the below URL http://www.webservicex.net/ws/WSDetails.aspx?CATID=2&WSID=10

Major components used in this Package 1. Web Service task


2. XML Task 3.Script Task

1.Steps to configure the Web Service Task :


Step 1 : Open new project of integration services and rename the default package name as Web service Step 2 : Drag and drop the Web Service Task in Package and Create two variables (currency,CurrencyXML ) in package scope

Step 3 : Create new HTTP Connection by right click in connection manager and select HTTP connection

and enter the Server URL as

http://www.webservicex.net/CurrencyConvertor.asmx?WSDL and test the test Connection

Step 4 : open the one new Notepad and save it as Currency_Convertor.wsdl

Step 5 : Double click on the Web service task and Configure the below

In General tab : Http Connection WSDL file OverwriteWSDLFile to download the WSL -------> HTTP Connection Manager which is taken in Step 3 . --------> Browse and select the Currency_Convertor.wsdl file ----> set as True because we have taken the empty WSDL file and we need file and overwrite to empty WSDL file

Click on the Download WSDL then we will get the Successfully downloaded popup .

Input tab : In Input tab we have to configure Service --------------------> CurrencyConvertor Method ---------------------> ConversionRate and also we need to select the FromCurrency value and Tocurrency value . In this Example we have taken FromCurrency as USD(US Dollor) and Tocurrency(INR Indian Rupee)

Ouptut : In output tab we have to configure the Output type . Output types are two type 1. File Type 2.Variable In this example we are taking Output variable as CurrencyXML

2. Step to configure the XML Task (Read the CoversionRate from the variable CurrencyXML )

Step 6 : a. Double click on the XML Task and select the Operation Type as XPATH

b. Configure like below screenshot InPut Tab SourceTpe--------------------> Variable Source by ------------------->variable CurrencyXML Output Tab SaveOperationResult --->True OperationResult DestinationType-------> variable Destination -------->Currency OverwriteDestination ---->True Second Operand SencondOperand ---->/bouble XPath Options XPathOperation ---->values

3. Step to configure the Script Task to display value of Currency Rate


we can finally observe/validate the value of currency conversion Rate in either watchlist or through script task 1. watch list : To watch the Variable values in the execution time we need to set the Breakpoints to the Task . In this example put the Post execute Break Point to the XML Task

in watch1 enter the variable Name then it will show like below

Script Task : Drag and drop the Script task and double click on it and select the Readonlyvariable as Curreny and enter the below code in the main method

S-ar putea să vă placă și