![]() |
Database »
Database »
SQL Server
Beginner
License: The Code Project Open License (CPOL)
Calling a Web Service from a SQL Integration Services packageBy Simon BonelloHow to call a Web Service from a SQL Integration Services package. |
C#, SQL Server (SQL 2005), Dev
|
|
Advanced Search |
|
|
|
||||||||||||||||
The SSIS framework provides a Web Service task which executes a Web Service method. You can use the Web Service task for the following purposes:

This article defines a step by step approach to using a Web Service call in SQL Integration Services.
First, create a web service project.

Now, expose a method call in the Web Service:
public class SSISService : System.Web.Services.WebService
{
[WebMethod]
public string HelloMoon()
{
return "Hello Moon";
}
[WebMethod]
public int Multiply(int nParam1, int nParam2)
{
return nParam1 * nParam2;
}
}
Create an SSIS package:

Add a web service task:


Next, modify the Web Service task:


Now, define the HTTP connection:

The next step is to define the WSDL file:

Define the Web Service Task inputs:

Now, define the Web Service output. The output of the Web Service can be written to variables or to an output file. This sample outputs the results from the Web Service to a file system file that is defined using the File Connection Manager Editor (Figure 11).


The following is the encoded output from the Web Service, stored in a test.txt file:
<?xml version="1.0" encoding="utf-16"?>
<int>200</int>
| You must Sign In to use this message board. | |||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 7 Apr 2008 Editor: Smitha Vijayan |
Copyright 2008 by Simon Bonello Everything else Copyright © CodeProject, 1999-2009 Web11 | Advertise on the Code Project |