我正在使用c#腳本任務的SSIS包。對於調試和日誌記錄,我想捕獲來自web服務的SOAP請求/響應。從web服務中捕獲肥皂請求/響應
現在,這是我以前從來沒有做過的事情,我有點卡住去哪裏。 我正在使用.Net的內置支持Web服務和生成的代理類。
任何幫助,這是非常感謝。
這裏是我當前的代碼:
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
}
}
'ZBatch_PublisherService.ZBatchPublisherServiceService'欺騙?你是如何創造它的? 「添加Web引用」/「添加服務」?它的基類是什麼? –
是的,ZBatch_PublisherService.ZBatchPublisherServiceService是使用添加引用/添加服務器創建的。基類是System.Web.Services.Protocols.SoapHttpClientProtocol – Tempname
可能的重複[在C#中,我將如何捕獲在Web服務調用中使用的SOAP?](http://stackoverflow.com/questions/306852/in- c-how-i-capture-the-soap-used-in-a-web-service-call) –