Monday, October 1, 2012

Webservice and SSIS


Calling a Web service from SSIS in 10 steps.........

In the below example I have explained how to call a web service from the SSIS package.

1.       Initially we have to create a Web service. Go to Visual Studio à New. Give an appropriate name to the service. Below I have used a Multiplication program.

 


 

2.       Update the .asmx page as given in the screen shot. Change the server name and method.



 

3.       After doing the modification run the service. So local host instance will run the web service.



4.       Next step we have to generate the WSDL file. For that we could use the <localaddress>+”?wsdl” in an address bar. Save the webpage as shown in the below figure.



 

5.       Create a new SSIS package with a suitable name. Use a Web Service Task and a Script Task in the control flow.



6.       In the Web Service Task Editor à General page map the WSDL file which we saved in the step 4.



7.       In the Input Tab you will get the service name and method name in the drop down box. If you want to pass user variable then you have to create the variables else you can give the values directly.



8.       In the output tab map to a user variable.



9.       Open the script task and pass the user outputvaraible and use a message text to display the output. The output variable data type should be a string type.

 

 

10.   Save the package and run the output is given below.



 

 

No comments:

Post a Comment