Add the Service link to the ServiceReferences folder, add System.ServiceModel to the help folder (this will use the EndPointAddress class in the script)
In the main method, use the following script (high level) to start with ...
var endPointAddress = new EndpointAddress('http://Server/ServiceName.svc');
var basicBinding = new BasicHttpBinding();
basicBinding.Name = "BasicHttpBinding_IService";
ClassServiceClient pay = new ClassServiceClient (basicBinding, endPointAddress);
IService = pay.YourMethodName();
XMLDocument xmlOut = new XmlDocument();
xmlOut.LoadXml(IService);
XmlNode xmlNode = xmlOut.SelectSingleNode("ParentElement/ChildElement");
string strValue = xmlNode.InnerText;
Then, using the DataTable class, load strValue, creating new lines
DataTable dt = new DataTable();
DataRow dr = dt.NewRow();
dr["ValueToInsertIntoDb"] = strValue;
dr.Rows.Add(dr);
After that, assign dt to the Object variable.
Dts.Variables["User::Values"].Value = dt;
Then use another data flow task inside which the script component is used and select the variable in ReadOnlyVariables. Inside the script component, you need to go through the DataTable dataset. Here is the code that should look like
DataTable dt = (DataTable)Variables.Values
foreach (DataRow dr in dt.Rows)
{
ScriptComponentOutputBuffer.AddRow()
ScriptComponentOutputBuffer.Column1 = dr["ValueToInsertIntoDb"].ToString();
}
//ScriptComponentOutputBuffer.Column1 --You need to manually add this column on output columns of your scriptcomponent
script OLEDB OLE DB Destination .