.Net Windows Form Client. Capturing Request/Response SOAP from ASMX webservice

做~自己de王妃 提交于 2019-12-13 06:17:06

问题


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...

http://blog.encoresystems.net/articles/how-to-capture-soap-envelopes-when-consuming-a-web-service.aspx

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.


回答1:


Have you tried using tracing in the config file as described in the MSDN articles How to: Configure Network Tracing and Configuring Tracing?




回答2:


Simply use a "Service Reference" instead of a "Web Reference" then see WCF Tracing.




回答3:


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.



来源:https://stackoverflow.com/questions/9218639/net-windows-form-client-capturing-request-response-soap-from-asmx-webservice

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!