Friday, April 13, 2012

How To Capture HTTP traffic

To capture WinHTTP logs
  1. Open an elevated command prompt window on the client PC.
  1. Run the following command: netsh winhttp set tracing trace-file-prefix="C:\Temp\dpws" level=verbose format=ansi state=enabled max-trace-file-size=1073741824This command enables WinHTTP logging. All log files will be stored in the C:\Temp directory, and the filenames will begin with the dpws prefix. At most 1 GB of log files will be stored.
  1. If the process using WinHTTP on the client is already running, restart the computer. For example, if the Function Discovery APIs are being used, the computer must be restarted. The Function Discovery APIs call WinHTTP from inside a service host, which may have already started when tracing was enabled.
  1. Start the WSDAPI-based client application. The application being debugged or the WSD Debug Client can be used.
  1. Reproduce the application failure.
  1. Terminate the WSDAPI-based client application.
  1. If the process using WinHTTP is not terminated with the client application, restart the computer. For example, if the Function Discovery APIs are being used, the computer must be restarted.
  2. Run the following command: netsh winhttp set tracing state=disabledThis command disables WinHTTP logging.

  1. Inspect the DPWS logs in C:\Temp and verify that the required requests and messages were sent.
  2. If secure channel (HTTPS) communication is being used, check for SSL/TLS failures.