Thursday, 23 March 2017

SSIS Call Web Method

Create a script task in SSIS and enter the following code: 

public void Main()



{

string url = (string) Dts.Variables["User::URL"].Value;

WebRequest request = HttpWebRequest.Create(url);

WebResponse response = request.GetResponse();

StreamReader reader = new StreamReader(response.GetResponseStream());

string urlText = reader.ReadToEnd();

Dts.TaskResult = (int)ScriptResults.Success;



}

No comments:

Post a Comment