Quantcast
Channel: Get xml web service request - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Jim Scott for Get xml web service request

$
0
0

I had to debug what was going across the line recently and tools like wireshark and fiddler are great tools for debugging the request and response unless you are using HTTPS or you are debugging on your local machine and executing the client and the web service locally.

I found a method that allows you to see the details of both the request and response without having to modify a single line of your code.

.NET has a feature built in called tracing. By enabling tracing for the System.NET namespace you can capture everything.

Here are the steps to enable.

Add the following code to your app.config in your client applications.

<system.diagnostics><trace autoflush="true"  /><sources><source name="System.Net"><listeners><add name="System.Net"/></listeners></source></sources><sharedListeners><add name="System.Net"        type="System.Diagnostics.TextWriterTraceListener"        initializeData="System.Net.trace.log" /></sharedListeners><switches><add name="System.Net" value="Verbose" /></switches></system.diagnostics>

Now when you execute your client application you can go into the folder that your executable was run from and find the file System.Net.trace.log

You will then find in the log file your request and the servers response. The great thing about this solution is you do not have to install or run anything extra. However the solution is probably only a solution for developing or diagnosing something in test or stage environment rather than production. However I am assuming because you mention creating the solution in Visual Studio and it not working that you are clearly in the development stage.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>