简体   繁体   English

如何查看通过网络发送的C#ASP.NET应用发送的SOAP请求数据?

[英]How to see SOAP request data sent by C# ASP.NET app that gets sent over network?

I have a C# ASP.NET application that is sending a post request to a WSDL based SOAP client and I would like to see the body of that request. 我有一个C#ASP.NET应用程序,它向基于WSDL的SOAP客户端发送一个发布请求,我希望看到该请求的主体。 The request is sent from the backend, not a browser. 该请求是从后端而不是浏览器发送的。 Plot twist: I lack permissions to install any network traffic sniffing software. 情节转折:我没有安装任何网络流量嗅探软件的权限。 What is a good way to see the XML being sent in the request? 查看请求中发送的XML的好方法是什么? I am using visual studio 2010. 我正在使用Visual Studio 2010。

Can you modify the application? 您可以修改应用程序吗? If so, a couple thoughts: 如果是这样,那么会有一些想法:

  1. Install Glimpse with a SOAP plugin . 使用SOAP插件安装Glimpse

or 要么

  1. Add some logging capability you can switch on/off via an appSetting . 添加一些日志记录功能,您可以通过appSetting打开/关闭。 Use that to trigger dumping it to a log file/database table. 使用它触发将其转储到日志文件/数据库表。 If you're already using Elmah you can piggy-back off it and dump it there. 如果您已经在使用Elmah ,则可以背负它并将其转储到那里。

or 要么

  1. You mentioned you couldn't install Fiddler, but what about on a different PC? 您提到您无法安装Fiddler,但是在另一台PC上呢? Fiddler supports r emote connections , so if you have it on another PC you could run it there and simply change the web.config in your app to use that as the proxy . Fiddler支持emote连接 ,因此,如果将其连接到另一台PC上,则可以在那里运行它,只需在应用程序中更改web.config即可将其用作代理

Can you install any software? 您可以安装任何软件吗? If so give fiddler a try, it's an http debugging proxy that does not require admin rights to install. 如果是这样,请试听小提琴手 ,它是一个http调试代理,不需要安装管理员权限。

Without installing any software this question, specifically this answer looks like it would do the trick. 在不安装任何软件的情况下, 这个问题,特别是这个答案似乎可以解决问题。 It contains the configuration to enable the System.Net tracing mechanism in the web.config. 它包含用于在web.config中启用System.Net跟踪机制的配置。

For an auto generated client from a service reference one of the answers to this question should work. 对于通过服务参考自动生成的客户端, 问题的答案之一应该起作用。 It's very similar to the answers above but specifically for a client generated from a service reference. 这与上面的答案非常相似,但专门针对从服务参考生成的客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM