【问题标题】:Capturing the soap request/response from a webservice从 Web 服务捕获肥皂请求/响应
【发布时间】:2011-10-27 19:09:01
【问题描述】:

我正在开发一个使用 c# 脚本任务的 SSIS 包。对于调试和日志记录,我想从 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
    }
}

【问题讨论】:

标签: c# ssis asmx


【解决方案1】:

对于调试,您可以使用 Fiddler2 轻松捕获任何 Web 流量,包括 SOAP 请求/响应的完整 xml(它甚至可以轻松处理 SSL,与 Wireshark 不同)

对于日志记录...我希望我知道。对不起。

另外,In C#, how would I capture the SOAP used in a web service call? 的欺骗

【讨论】:

  • 你是对的,调试提琴手工作得很好。但是,尝试记录请求是完全不同的故事。
猜你喜欢
  • 2012-05-07
  • 2010-12-20
  • 2020-07-29
  • 1970-01-01
  • 2015-05-30
  • 1970-01-01
  • 1970-01-01
  • 2011-12-27
  • 1970-01-01
相关资源
最近更新 更多