Http Client Protocol Issues

If you use any of these solutions, Please let me know so I can track if any of this is useful to you! Thanks! This is an area to share observations I have made working with Http Client Protocols and the associated technologies. I currently work for the Microsoft team that supports the WinInet, WinHTTP and System.Net API's and classes associated with these technologies. This is not a replacement for Microsoft Support, but an area to discuss these technologies. These postings are provided "AS IS" with no warranties, and confer no rights. Use of included code samples are subject to the terms specified at Microsoft - Information on Terms of Use

How to enable WinHttp Tracing on Vista, 2008 and Windows 7

WinhttpTracecfg.exe for Vista does not exist, so how can you get a WinHttp trace in Vista and above?

WinHttpTraceCfg.exe has been replaced in Vista and above with the netsh winhttp command.
see this blog:
http://blogs.msdn.com/wndp/archive/2007/03/21/winhttp-configuration-for-windows-vista.aspx

A typical command to enable full tracing for WinHttp would look like this:

C:\Windows\system32>netsh winhttp set tracing trace-file-prefix="C:\Temp\WinHttpLog" level=verbose format=hex state=enabled

You would reproduce the issue and then turn off tracing like this:

C:\Windows\system32>netsh winhttp set tracing state=disabled

 This would leave the other parameters you set previously to remain so the next time you want to enable tracing simply type:

C:\Windows\system32>netsh winhttp set tracing state=enabled

 

Other parameters are available:

C:\Windows\system32>netsh winhttp set tracing

will show you the options:

Usage:  set tracing
        [output=]file|debugger|both
        [trace-file-prefix=]<string>
        [level=]default|verbose
        [format=]ansi|hex
        [max-trace-file-size=]<number>
        [state=]enabled|disabled

Parameters:

  Tag                   Value
  trace-file-prefix   - Prefix for the log file (can include a path)
                        specify "*" to delete an existing prefix
  output              - Where the trace entries are written/displayed to
  level               - How much information to log
  format              - Display format of network traffic (hex or ansi)
  max-trace-file-size - Maximum size of the trace file (in bytes)
  state               - Enables or disables winhttp tracing

Examples:

  set tracing trace-file-prefix="C:\Temp\Test3" level=verbose format=hex
  set tracing output=debugger max-trace-file-size=512000 state=enabled

You can display the existing settings with this command:

C:\Windows\system32>netsh winhttp show tracing

Current WinHTTP Tracing settings:

    Tracing is not enabled.

    Trace File Prefix: C:\Temp\Test3
    Trace Output: file
    Trace Level:  verbose (headers, APIs, and entity body)
    Network Traffic Format: hex
    Maximum size of trace file (in bytes): 65535

Let me know if this helps!

Published Thursday, May 28, 2009 1:47 PM by jpsanders
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Submit

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker