.Net Windows 窗体客户端。从 ASMX Web 服务捕获请求/响应 SOAP
在我决定发布这个问题之前,我在这里浏览了几篇文章和问题......这些似乎都不是我的解决方案......或者我做错了什么。
我浏览了本网站推荐的这篇文章 http://www.codeproject.com/Articles/38986/Trace-SOAP-Request-Response-XML-with-TraceExtensio?msg=4152902#xx4152902xx
不起作用。连我下载的源代码都没有。
然后我找到了另一篇文章...
这很简单。 我有一个客户端(winform)...与我无法控制的网络服务交互,并且我需要能够捕获肥皂请求和响应。到目前为止,我遵循了 5 个教程,soapextensions、soapattributes 等等……似乎没有什么对我有用。我已经修改了app.config,按照书本做了所有事情......什么也没做。
问题...有人有这方面的可行示例吗?我发现的两个示例不起作用:)
我正在使用 Visual Studio 2010。
before i decided to post this question i went thru several articles and questions in here... none of those seem to be a solution for me.... or i am doing something wrong.
I went thru this article, suggested in this site
http://www.codeproject.com/Articles/38986/Trace-SOAP-Request-Response-XML-with-TraceExtensio?msg=4152902#xx4152902xx
that's not working. Not even the source code i downloaded.
then i found this other article...
This is simple.
I have a client (winform)... interacts with a webservice i have no control over, and i need to be able to capture the soap request and response. i followed like 5 tutorials so far, soapextensions, soapattributes, etc, etc... nothing seems to work for me. i have modified app.config, done everything by the book... nothing.
Question... Does anyone have a WORKING example of this? the two examples i found don't work :)
I am using Visual Studio 2010.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否尝试过在配置文件中使用跟踪,如 MSDN 文章如何:配置中所述网络跟踪和配置跟踪?
Have you tried using tracing in the config file as described in the MSDN articles How to: Configure Network Tracing and Configuring Tracing?
只需使用“服务引用”而不是“Web 引用”,然后查看 WCF 跟踪。
Simply use a "Service Reference" instead of a "Web Reference" then see WCF Tracing.
SOAP 扩展需要在服务端注册(这就是为什么所有帖子都要求您在 web.config 中进行配置)。
如果您想在 WinForms 客户端中打印 SOAP 消息,则必须以“原始”方式调用 Web 服务,
http://mikehadlow.blogspot.com/2006/05/making-raw-web-service-calls-with.html
@James 演示了 System.NET 跟踪,这是在外部日志文件中查看 SOAP 消息的另一种方法,但这仅对故障排除有用,因为您不会在客户端内收到跟踪数据。
SOAP extensions need to be registered on the service side (that's why all posts asking you to do configuration inside web.config).
If you want to print out the SOAP messages inside your WinForms client, you will have to call web service in the "raw" way,
http://mikehadlow.blogspot.com/2006/05/making-raw-web-service-calls-with.html
@James demonstrates System.NET tracing, which is another way to see the SOAP messages in an external log file, but that's only useful for troubleshooting, as you won't receive the tracing data inside your client.