I am working on an SSIS package that uses a c# script task. For debugging and logging I would like to capture the soap request/response from the webservice.
Now is this something I have never had to do before and I am a bit stuck with where to go. I am using .Net's built in support for webservices and the generated proxy class.
Any help with this is greatly appreciated.
Here is my current code:
public void Main()
{
try
{
DataTable dt = new DataTable();
OleDbDataAdapter oleDa = new OleDbDataAdapter();
ArrayList itemArray = new ArrayList();
ArrayList orderArray = new ArrayList();
oleDa.Fill(dt, Dts.Variables["User::ZBatch_Order_Export_ResultSet"].Value);
int i = 0;
foreach (DataRow row in dt.Rows)
{
orderArray.Add(ConstructOrderTransaction(row));
itemArray.Add(ConstructItemTransaction(row));
i++;
}
ZBatch_PublisherService.ZBatchPublisherServiceService ws = new ZBatchPublisherServiceService();
ZBatch_PublisherService.bcfItemTransaction[] itemObjects = itemArray.ToArray() as bcfItemTransaction[];
ZBatch_PublisherService.bcfOrderTransaction[] orderObjects = orderArray.ToArray() as bcfOrderTransaction[];
ZBatch_PublisherService.zBatchResults results = new zBatchResults();
results = ws.saveBatch(orderObjects, itemObjects);
Dts.TaskResult = (int)ScriptResults.Success;
}
catch (Exception e)
{
Dts.Events.FireError(0, "ZBatch - Script Task", e.Message.ToString(), string.Empty, 0);
// do some logging of this error message
}
}