原文 SSIS Package to Call Web Service

SSIS Package to Call Web Service.

You can Call WebService from SSIS package and transfers your data.

First of all you have to create web service with function as  you needed to call.

Step1 : Go To Microsoft Visual Studio –> New –> WebSite –> ASP.Net WebService and provide you web service name.

Step2 : Paste below code to your Service1.asmx.vb file.

I have created new function “MyHelloWorld” with parameter name in which i am passing a string to write in a destination file.

1 Imports System.Web.Services
2 Imports System.Web.Services.Protocols
3 Imports System.ComponentModel
4  
5 ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
6 ' <System.Web.Script.Services.ScriptService()> _
7 <System.Web.Services.WebService(Namespace:="<a href="http://tempuri.org/">http://tempuri.org/</a>")> _
8 <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
9 <ToolboxItem(False)> _
10 Public Class Service1
11     Inherits System.Web.Services.WebService
12     <WebMethod()> _
13     Public Function MyHelloWorld(ByVal nameAs String
14         Dim FILE_NAME As String = "E:\WebServiceTextFromService.txt"
15         Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
16  
17         objWriter.Write(name)
18         objWriter.Close()
19         Return "Process Completed."
20     End Function
21  
22 End Class

Step3 : Now Create New SSIS Package with your desired name.

Drag Weservice Task to Control Flow.

Create one variable “Result” with datatype string and value “I am writting this content to file by web service task”.

Step4 : Create one http connection manager. i am using 61508 port number for my local web service so my Server URL :http://localhost:61508.

This port number is assigned by default, you can change port number from web service property.

Step5 : Create one file connection to write output result to local path.

Step6 :  Right click on Web Service Task –> Edit.

On General Tab Select HTTP Connection Manger which you have created on Step4.

Select your WSDL file path to WSDLFile field.

Step7 : Select Input path of Web Service Task Editor.

Select your service name in Service and Method “MyHelloWorld” which you have created on Step2.

After selecting Method, Parameter field enables automatically.

Click on Variable checkbox and select User::Result in value .

Step8 : Select OutPut tab on left pane on Web Service Task Editor.

Select Flat File Connection “WebServiceText.txt” in File Field.

Step9 : After completing this build and run the project and you will get file will be created on “D:\WebServiceText.txt”

with the content “I am writting this content to file by web service task”.

Regards,

Nirav Gajjar

最新文章

  1. VirtualBox中Ubuntu 14.04屏幕分辨率不能设置的问题
  2. JavaScript变量声明
  3. param STRING $username 要检查的用户名
  4. Helpers\FastCache
  5. write_chip,read_chip
  6. java_接口的应用
  7. SVN最有效的方法打基线
  8. 读书笔记—CLR via C#异常和状态管理
  9. 【CSS初识】
  10. SQL语句-INSERT语句
  11. x264源代码简单分析:概述
  12. packetfence 7.2网络准入部署(二)
  13. git解决冲突插件之Beyond Compare
  14. find的用法(完整)
  15. SonarQube 平台搭建代码审查平台步骤
  16. mysql的导入导出工具mysqldump命令详解
  17. PAT乙级1036
  18. hdu2795 Billboard(线段树单点修改)
  19. awstat分析nginx日志
  20. QT creator出现 no executable specified时解决办法

热门文章

  1. poj3903 Stock Exchange(最长上升子序列)
  2. GRUB三步通(转)
  3. Centos7系统配置上的变化(一)
  4. git 如何让单个文件回退到指定的版本
  5. UVA11080- Place the Guards(二分图染色)
  6. MAX2323E - 原理图系列
  7. Oracle 树操作
  8. 软件开发V型号
  9. SDUT 1124-飞跃荒野(三维BFS)
  10. QTP 11.05下载并完成+皴